Package: backuppc
Version: 2.1.2-4
Severity: wishlist
Tags: patch

Hi,

backuppc rotates the client logfiles in the first night of the month.
But clients that are configured to not do any regular backups
($Conf{FullPeriod} < 0) and didn't do any manually triggered backups
don't produce any log entries, so rotating the logs is superfluous.

I attach a one line patch that skips the rotate if the logfile is empty.


Andreas
Index: bin/BackupPC_nightly
===================================================================
RCS file: /cvsroot/backuppc/BackupPC/bin/BackupPC_nightly,v
retrieving revision 1.18
diff -u -r1.18 BackupPC_nightly
--- bin/BackupPC_nightly        29 Jan 2006 19:05:11 -0000      1.18
+++ bin/BackupPC_nightly        30 May 2006 01:19:38 -0000
@@ -227,6 +227,7 @@
     my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
     if ( $mday == 1 ) {
         foreach my $host ( keys(%Status) ) {
+            next if -z "$TopDir/pc/$host/LOG";
             my $lastLog = $Conf{MaxOldPerPCLogFiles} - 1;
             unlink("$TopDir/pc/$host/LOG.$lastLog")
                     if ( -f "$TopDir/pc/$host/LOG.$lastLog" );

Reply via email to