#
#========================================================================
#
-# Version 3.0.0beta0, released 11 Jul 2006.
+# Version 3.0.0, released 28 Jan 2007.
#
# See http://backuppc.sourceforge.net.
#
use lib "/usr/local/BackupPC/lib";
use BackupPC::Lib;
use BackupPC::FileZIO;
+use Encode;
use File::Path;
use Data::Dumper;
# Read old status
#
if ( -f "$LogDir/status.pl" && !(my $ret = do "$LogDir/status.pl") ) {
- die "couldn't parse $LogDir/status.pl: $@" if $@;
- die "couldn't do $LogDir/status.pl: $!" unless defined $ret;
- die "couldn't run $LogDir/status.pl";
+ if ( $@ ) {
+ print STDERR "couldn't parse $LogDir/status.pl: $@";
+ } elsif ( !defined($ret) ) {
+ print STDERR "couldn't do $LogDir/status.pl: $!";
+ } else {
+ print STDERR "couldn't run $LogDir/status.pl";
+ }
}
#
# Write out our initial status and save our PID
#
StatusWrite();
+ unlink("$LogDir/BackupPC.pid");
if ( open(PID, ">", "$LogDir/BackupPC.pid") ) {
print(PID $$);
close(PID);
+ chmod(0444, "$LogDir/BackupPC.pid");
}
#
last;
}
$Clients{$client}{mesgCnt}++;
- $cmd = $2;
+ $cmd = decode_utf8($2);
if ( $cmd =~ /^stop (\S+)\s+(\S+)\s+(\S*)/ ) {
$host = $1;
my $user = $2;