1 |
wellsi |
1.1 |
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 |
2 |
|
|
--- e-smith-backup-2.4.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-05 15:14:23.000000000 -0800 |
3 |
|
|
+++ e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-05 15:26:19.000000000 -0800 |
4 |
|
|
@@ -24,11 +24,10 @@ |
5 |
|
|
use Errno; |
6 |
|
|
use esmith::util; |
7 |
|
|
use esmith::templates; |
8 |
|
|
-use Time::localtime; |
9 |
|
|
use File::Copy; |
10 |
|
|
use File::Path qw(make_path remove_tree); |
11 |
|
|
use File::Find; |
12 |
|
|
-use POSIX ":sys_wait_h"; |
13 |
|
|
+use POSIX qw(:sys_wait_h strftime); |
14 |
|
|
use File::Glob qw(bsd_glob); |
15 |
|
|
use esmith::ConfigDB; |
16 |
|
|
|
17 |
|
|
@@ -43,27 +42,14 @@ |
18 |
|
|
my $backupwk = $confdb->get('backupwk') or die "No backupwk db entry found\n"; |
19 |
|
|
my $internalinterface = $confdb->get('InternalInterface') or die "No internalinterface db entry found\n"; |
20 |
|
|
|
21 |
|
|
-my $tm = localtime(time); |
22 |
|
|
-my $bkname = $tm->year+1900; |
23 |
|
|
+my $bkname = strftime '%Y%m%d%H%M%S', localtime; |
24 |
|
|
+my $dow = strftime '%w', localtime; |
25 |
|
|
|
26 |
|
|
-$bkname .= "0" if ($tm->mon < 9); |
27 |
|
|
-$bkname .= $tm->mon + 1; |
28 |
|
|
- |
29 |
|
|
-$bkname .= "0" if ($tm->mday < 10); |
30 |
|
|
-$bkname .= $tm->mday; |
31 |
|
|
- |
32 |
|
|
-$bkname .= "0" if ($tm->hour < 10); |
33 |
|
|
-$bkname .= $tm->hour; |
34 |
|
|
- |
35 |
|
|
-$bkname .= "0" if ($tm->min < 10); |
36 |
|
|
-$bkname .= $tm->min; |
37 |
|
|
- |
38 |
|
|
-my $dow = $tm->wday; |
39 |
|
|
my $id = $backupwk->prop('Id') || |
40 |
|
|
$confdb->get('SystemName')->value . "." . $confdb->get('DomainName')->value; |
41 |
|
|
my $err; |
42 |
|
|
my $ref = ""; |
43 |
|
|
-my $tim = ctime(); |
44 |
|
|
+ |
45 |
|
|
|
46 |
|
|
my $smbhost = $backupwk->prop('SmbHost'); |
47 |
|
|
my $smbshare = $backupwk->prop('SmbShare'); |
48 |
|
|
@@ -93,7 +79,7 @@ |
49 |
|
|
$report .= "================================== \n"; |
50 |
|
|
$report .= "DAILY BACKUP TO WORKSTATION REPORT \n"; |
51 |
|
|
$report .= "================================== \n"; |
52 |
|
|
-$report .= "Backup of ".$id." started at " .$tim . "\n"; |
53 |
|
|
+$report .= "Backup of ".$id." started at " .localtime() . "\n"; |
54 |
|
|
|
55 |
|
|
# ping the SMB Host to see if it is awake |
56 |
|
|
|
57 |
|
|
@@ -259,8 +245,7 @@ |
58 |
|
|
$backupwk->set_prop('SetNum', $setnum); |
59 |
|
|
$backupwk->set_prop('IncNum', $incnum); |
60 |
|
|
|
61 |
|
|
-$tim = ctime(); |
62 |
|
|
-$report .= "Backup successfully terminated at $tim \n"; |
63 |
|
|
+$report .= "Backup successfully terminated at ".localtime()."\n"; |
64 |
|
|
|
65 |
|
|
if ($mail eq 'yes') |
66 |
|
|
{ |