[vhffs-dev] [2065] reworked mysql_dump.pl and pgsql_dump.pl

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 2065
Author:   gradator
Date:     2012-02-26 03:11:42 +0100 (Sun, 26 Feb 2012)
Log Message:
-----------
reworked mysql_dump.pl and pgsql_dump.pl

Modified Paths:
--------------
    trunk/vhffs-robots/src/mysql_dump.pl
    trunk/vhffs-robots/src/pgsql_dump.pl

Modified: trunk/vhffs-robots/src/mysql_dump.pl
===================================================================
--- trunk/vhffs-robots/src/mysql_dump.pl	2012-02-26 02:01:26 UTC (rev 2064)
+++ trunk/vhffs-robots/src/mysql_dump.pl	2012-02-26 02:11:42 UTC (rev 2065)
@@ -38,27 +38,20 @@
 use utf8;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Functions;
-use Vhffs::Services::Mysql;
-use Vhffs::Robots;
 use Vhffs::Robots::Mysql;
 
-my $vhffs = init Vhffs::Main; 
+my $vhffs = init Vhffs::Main;
+exit 1 unless defined $vhffs;
 
-Vhffs::Robots::lock( $vhffs , 'dumpmysql' );
-
 my $mysqlconf = $vhffs->get_config->get_service('mysql');
 die 'Error, mysqldump is not present on this system in path "'.$mysqlconf->{'mysqldump_path'}.'"'."\n" unless -x $mysqlconf->{'mysqldump_path'};
 
-my $objs  = Vhffs::Services::Mysql::getall( $vhffs , Vhffs::Constants::ACTIVATED , undef , undef );
-foreach my $obj ( @{$objs} )
-{
-	Vhffs::Robots::Mysql::dump_night( $obj );
+Vhffs::Robots::lock( $vhffs, 'dumpmysql' );
+
+my $repos = Vhffs::Services::Mysql::getall( $vhffs, Vhffs::Constants::ACTIVATED );
+foreach ( @{$repos} ) {
+	Vhffs::Robots::Mysql::dump_night( $_ );
 }
 
-Vhffs::Robots::unlock( $vhffs , 'dumpmysql' );
-
+Vhffs::Robots::unlock( $vhffs, 'dumpmysql' );
 exit 0;

Modified: trunk/vhffs-robots/src/pgsql_dump.pl
===================================================================
--- trunk/vhffs-robots/src/pgsql_dump.pl	2012-02-26 02:01:26 UTC (rev 2064)
+++ trunk/vhffs-robots/src/pgsql_dump.pl	2012-02-26 02:11:42 UTC (rev 2065)
@@ -38,27 +38,20 @@
 use utf8;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::Main;
-use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Functions;
-use Vhffs::Services::Pgsql;
-use Vhffs::Robots;
 use Vhffs::Robots::Pgsql;
 
-my $vhffs = init Vhffs::Main; 
+my $vhffs = init Vhffs::Main;
+exit 1 unless defined $vhffs;
 
-Vhffs::Robots::lock( $vhffs , 'dumppgsql' );
-
 my $pgsqlconf = $vhffs->get_config->get_service('pgsql');
 die 'Error, pg_dump is not present on this system in path "'.$pgsqlconf->{'pgdump_path'}.'"'."\n" unless -x $pgsqlconf->{'pgdump_path'};
 
-my $objs = Vhffs::Services::Pgsql::getall( $vhffs , Vhffs::Constants::ACTIVATED , undef , undef );
-foreach my $obj ( @{$objs} )
-{
-	Vhffs::Robots::Pgsql::dump_night( $obj );
+Vhffs::Robots::lock( $vhffs, 'dumppgsql' );
+
+my $repos = Vhffs::Services::Pgsql::getall( $vhffs, Vhffs::Constants::ACTIVATED );
+foreach ( @{$repos} ) {
+	Vhffs::Robots::Pgsql::dump_night( $_ );
 }
 
-Vhffs::Robots::unlock( $vhffs , 'dumppgsql' );
-
+Vhffs::Robots::unlock( $vhffs, 'dumppgsql' );
 exit 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/