#!/usr/bin/perl
#!/usr/sh
#use strict;

(my $hostname, my $job, my $command, my $error) = @ARGV;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);

open (MYFILE, '>/root/backupreport');
print MYFILE $error ."\n";
if ($error == 0){
	open (MYFILE2, '>/root/backupreport.success');
	print MYFILE2 $err;
	printf MYFILE2 "%4d-%02d-%02d %02d:%02d",$year+1900,$mon+1,$mday,$hour,$min;
	close (MYFILE2);
}
close (MYFILE);
exit 0;
