[slbackup-commit] CVS update: slbackup/src slbackup-cron
werner at alioth.debian.org
werner at alioth.debian.org
Thu Feb 2 22:59:32 UTC 2006
User: werner
Date: 06/02/02 22:59:32
Modified: src slbackup-cron
Log:
cleaning up before new release
Revision Changes Path
1.16 +13 -2 slbackup/src/slbackup-cron
Index: slbackup-cron
===================================================================
RCS file: /cvsroot/slbackup/slbackup/src/slbackup-cron,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- slbackup-cron 30 Jan 2006 06:12:52 -0000 1.15
+++ slbackup-cron 2 Feb 2006 22:59:32 -0000 1.16
@@ -48,6 +48,10 @@
$debug = 1 if $opt_v;
&usage() if $opt_h;
+# errorsets = Number of backup sets (clients) from config for which
+# rdiff-backup fails
+my $errorclients = 0;
+
# open logfile
open (LOG, ">>$logfile") or die ("Unable to open $logfile\n");
logger ("Starting slbackup:");
@@ -366,6 +370,7 @@
logger ("Successfully finished backing up client $key");
} else {
logger ("Failed backing up client $key");
+ $errorclients += 1;
}
}
@@ -392,5 +397,11 @@
printflush LOG ("$now - $comment\n");
}
-1;
+if ( $errorclients gt 0 ) {
+ # exit 1 if any of the client's failed
+ print STDERR "Error: backup failed for one or more of your clients.";
+ print STDERR " Please take a look at $logfile for details.";
+ exit 1;
+}
+exit 0;
More information about the slbackup-commit
mailing list