4 use warnings FATAL
=> 'all';
6 use constant LOGFILE
=> '/var/log/rsync-shell.log';
15 '/afs/hcoop.net/common/etc/scripts/hcoop-backup-wrapper';
21 if ( $cmdline !~ m!^--server --sender -vre\.iL --bwlimit=325 \. /vicepa/hcoop-backups/files/[0-9]{4}\.[0-9]{2}\.[0-9]{2}$!s ) {
22 die "Incorrect arguments to rsync.\n";
25 exec '/usr/bin/rsync', split(' ', $cmdline)
26 or die "Could not run rsync command.\n";
30 -f LOGFILE
&& open (LOG
, '>>', LOGFILE
)
31 or die "Can't open log file.\n";
33 print LOG
"Session started on ", `date`;
34 print LOG
"Commands: ", map { "<$_> " } @ARGV;
37 $ARGV[1] =~ /^([^ ]+) *(.*?)$/s;
38 my $cmd = $commands{$1}
39 or die "Unsupported command.\n";