Hi folks.
Im seeking your wisdom, please, enlight me.
This its a piece of the code im using, its a perl script to run backups from linux servers from everything.
The problem its, i want to know if something fails using rsync. I took a look to the Rsync module on CPAN and it would give me the option to catch up the stderr, so it could be nice, but its mandatory that i use a ssh certificate instead a password / login to access the remote rsync server. And perl wrapper rsync module doesnt give this thing.
Anyone knows how i can catch back the results of the rsync ? There's another possibility than parse the $_ while i am reading it?
# MYSQL BACKUP
my @bk_mysql = qx(/usr/bin/mysql -u $uMy -p$pMy -e 'show databases');
foreach $1 (@bk_mysql){
chomp $1;
$fMy = "mysql_-$1-$tLog";
$mysqlC ++;
print "$mysqlC MySQL Database $1\n";
qx (mysqldump -u $uMy -p$pMy $1 | gzip -9 > $foMy/$fMy.gz );
print "Compressing file $fMy\n";
qx (/usr/bin/rsync -avzP -e "ssh -i /root/.ssh/rsyncstrato" $
+foMy/$fMy.gz account-xxxx\@rsync.hidrive.strato.com:/users/account-xx
+xx/backups/mysql/$tLog/ );
print "Sending Backup to Cloud..\n";
qx (rm $foMy/$fMy.gz);
print "Backup file uploaded and deleted $foMy/$fMy\n";
printf LOG "DB DONE -> $foMy/$fMy\n";
push @mysql_re, $fMy;
push @mysql_status, @$;
}