+if ( $opts{m} ) {
+ print("log BackupPC_nightly now running BackupPC_sendEmail\n");
+ system("$BinDir/BackupPC_sendEmail")
+}
+
+#
+# Do per-PC log file aging
+#
+sub doPerPCLogFileAging
+{
+ my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+ if ( $mday == 1 ) {
+ foreach my $host ( keys(%Status) ) {
+ my $lastLog = $Conf{MaxOldPerPCLogFiles} - 1;
+ unlink("$TopDir/pc/$host/LOG.$lastLog")
+ if ( -f "$TopDir/pc/$host/LOG.$lastLog" );
+ unlink("$TopDir/pc/$host/LOG.$lastLog.z")
+ if ( -f "$TopDir/pc/$host/LOG.$lastLog.z" );
+ for ( my $i = $lastLog - 1 ; $i >= 0 ; $i-- ) {
+ my $j = $i + 1;
+ if ( -f "$TopDir/pc/$host/LOG.$i" ) {
+ rename("$TopDir/pc/$host/LOG.$i",
+ "$TopDir/pc/$host/LOG.$j");
+ } elsif ( -f "$TopDir/pc/$host/LOG.$i.z" ) {
+ rename("$TopDir/pc/$host/LOG.$i.z",
+ "$TopDir/pc/$host/LOG.$j.z");
+ }
+ }
+ #
+ # Compress the log file LOG -> LOG.0.z (if enabled).
+ # Otherwise, just rename LOG -> LOG.0.
+ #
+ BackupPC::FileZIO->compressCopy("$TopDir/pc/$host/LOG",
+ "$TopDir/pc/$host/LOG.0.z",
+ "$TopDir/pc/$host/LOG.0",
+ $Conf{CompressLevel}, 1);
+ open(LOG, ">", "$TopDir/pc/$host/LOG") && close(LOG);
+ }
+ }
+}