diff -ruN e-smith-backup-2.4.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar --- e-smith-backup-2.4.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-05 15:14:23.000000000 -0800 +++ e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-05 15:26:19.000000000 -0800 @@ -24,11 +24,10 @@ use Errno; use esmith::util; use esmith::templates; -use Time::localtime; use File::Copy; use File::Path qw(make_path remove_tree); use File::Find; -use POSIX ":sys_wait_h"; +use POSIX qw(:sys_wait_h strftime); use File::Glob qw(bsd_glob); use esmith::ConfigDB; @@ -43,27 +42,14 @@ my $backupwk = $confdb->get('backupwk') or die "No backupwk db entry found\n"; my $internalinterface = $confdb->get('InternalInterface') or die "No internalinterface db entry found\n"; -my $tm = localtime(time); -my $bkname = $tm->year+1900; +my $bkname = strftime '%Y%m%d%H%M%S', localtime; +my $dow = strftime '%w', localtime; -$bkname .= "0" if ($tm->mon < 9); -$bkname .= $tm->mon + 1; - -$bkname .= "0" if ($tm->mday < 10); -$bkname .= $tm->mday; - -$bkname .= "0" if ($tm->hour < 10); -$bkname .= $tm->hour; - -$bkname .= "0" if ($tm->min < 10); -$bkname .= $tm->min; - -my $dow = $tm->wday; my $id = $backupwk->prop('Id') || $confdb->get('SystemName')->value . "." . $confdb->get('DomainName')->value; my $err; my $ref = ""; -my $tim = ctime(); + my $smbhost = $backupwk->prop('SmbHost'); my $smbshare = $backupwk->prop('SmbShare'); @@ -93,7 +79,7 @@ $report .= "================================== \n"; $report .= "DAILY BACKUP TO WORKSTATION REPORT \n"; $report .= "================================== \n"; -$report .= "Backup of ".$id." started at " .$tim . "\n"; +$report .= "Backup of ".$id." started at " .localtime() . "\n"; # ping the SMB Host to see if it is awake @@ -259,8 +245,7 @@ $backupwk->set_prop('SetNum', $setnum); $backupwk->set_prop('IncNum', $incnum); -$tim = ctime(); -$report .= "Backup successfully terminated at $tim \n"; +$report .= "Backup successfully terminated at ".localtime()."\n"; if ($mail eq 'yes') {