X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC;h=61276e22fdbf0ae89bde61b00350fb720aac21ca;hp=3f1fa2b1bbb5b93216087e47460826eab58d8d2f;hb=2c14784ad71874ec850d189060fe63d6eb9eba95;hpb=72b87b178ae8dcc10f1ae0f441d13e30d5f1ecf1;ds=sidebyside diff --git a/bin/BackupPC b/bin/BackupPC index 3f1fa2b..61276e2 100755 --- a/bin/BackupPC +++ b/bin/BackupPC @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*- # # BackupPC: Main program for PC backups. @@ -47,7 +47,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -818,6 +818,17 @@ sub Main_Check_Job_Messages $Status{$host}{startTime} = time; $Status{$host}{deadCnt} = 0; $Status{$host}{aliveCnt}++; + } elsif ( $mesg =~ /^started_archive/ ) { + $Jobs{$host}{type} = "archive"; + print(LOG $bpc->timeStamp, + "Started archive on $host" + . " (pid=$Jobs{$host}{pid})\n"); + $Status{$host}{state} = "Status_archive_in_progress"; + $Status{$host}{reason} = ""; + $Status{$host}{type} = "archive"; + $Status{$host}{startTime} = time; + $Status{$host}{deadCnt} = 0; + $Status{$host}{aliveCnt}++; } elsif ( $mesg =~ /^(full|incr) backup complete/ ) { print(LOG $bpc->timeStamp, "Finished $1 backup on $host\n"); $Status{$host}{reason} = "Reason_backup_done"; @@ -830,6 +841,12 @@ sub Main_Check_Job_Messages delete($Status{$host}{error}); delete($Status{$host}{errorTime}); $Status{$host}{endTime} = time; + } elsif ( $mesg =~ /^archive complete/ ) { + print(LOG $bpc->timeStamp, "Finished archive on $host\n"); + $Status{$host}{reason} = "Reason_archive_done"; + delete($Status{$host}{error}); + delete($Status{$host}{errorTime}); + $Status{$host}{endTime} = time; } elsif ( $mesg =~ /^nothing to do/ ) { if ( $Status{$host}{reason} ne "Reason_backup_failed" && $Status{$host}{reason} ne "Reason_restore_failed" ) { @@ -868,6 +885,13 @@ sub Main_Check_Job_Messages $Status{$host}{errorTime} = time; $Status{$host}{endTime} = time; print(LOG $bpc->timeStamp, "Restore failed on $host ($1)\n"); + } elsif ( $mesg =~ /^archive failed: (.*)/ ) { + $Status{$host}{state} = "Status_idle"; + $Status{$host}{reason} = "Reason_archive_failed"; + $Status{$host}{error} = $1; + $Status{$host}{errorTime} = time; + $Status{$host}{endTime} = time; + print(LOG $bpc->timeStamp, "Archive failed on $host ($1)\n"); } elsif ( $mesg =~ /^log\s+(.*)/ ) { print(LOG $bpc->timeStamp, "$1\n"); } elsif ( $mesg =~ /^BackupPC_stats = (.*)/ ) { @@ -1225,7 +1249,7 @@ sub Main_Check_Client_Messages } elsif ( $cmd =~ /^server\s+(\w+)/ ) { my($type) = $1; if ( $type eq 'reload' ) { - ServerReload("Reloading server configuration..."); + ServerReload("Reloading config/host files via CGI request"); } elsif ( $type eq 'shutdown' ) { $reply = "Shutting down...\n"; syswrite($Clients{$client}{fh}, $reply, length($reply));