1 |
wellsi |
1.1 |
diff -ruN e-smith-backup-2.4.0.p25/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.p25/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-08 20:06:35.000000000 -0800 |
3 |
|
|
+++ e-smith-backup-2.4.0/root/etc/e-smith/events/actions/workstation-backup-dar 2014-02-08 20:56:33.000000000 -0800 |
4 |
|
|
@@ -86,7 +86,7 @@ |
5 |
|
|
} |
6 |
|
|
|
7 |
|
|
# create the directory mount point if it does not exist |
8 |
|
|
-createTree ($mntdir); |
9 |
|
|
+&createTree ($mntdir); |
10 |
|
|
|
11 |
|
|
# mount the backup directory |
12 |
|
|
my $err = &dmount($smbhost,$smbshare,$mntdir,$login,$password,$VFSType); |
13 |
|
|
@@ -174,17 +174,17 @@ |
14 |
|
|
} |
15 |
|
|
$report .= "Starting the backup with a timeout of ". int ($timeout/(60*60)). " hours\n"; |
16 |
|
|
|
17 |
|
|
-# expanding backup configuration file template |
18 |
|
|
+# Expand backup configuration file template |
19 |
|
|
+processTemplate ({TEMPLATE_PATH => "/etc/dar/$job.dcf"}); |
20 |
|
|
|
21 |
|
|
-processTemplate({ |
22 |
|
|
- TEMPLATE_PATH => "/etc/dar/$job.dcf", |
23 |
|
|
- }); |
24 |
|
|
- |
25 |
|
|
-# launching dar backup |
26 |
|
|
-if (($deleteearly eq 'true') && (($incnum == 0))) # Allow delete before backup |
27 |
|
|
+# If this is a new set and delete before backup is in use |
28 |
|
|
+# then empty target directory of any .dar files |
29 |
|
|
+if (($deleteearly eq 'true') && (($incnum == 0))) |
30 |
|
|
{ |
31 |
|
|
- &removeTree ($setdirname); |
32 |
|
|
- &createTree ($setdirname); |
33 |
|
|
+ foreach my $file (glob("$setdirname/*.dar")) |
34 |
|
|
+ { |
35 |
|
|
+ unlink $file or ldie("Error deleting old backup files in $setdirname : $!") |
36 |
|
|
+ } |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
my $destination = ($deleteearly ne 'true') ? "$mntdir/$id/$bkname" : "$setdirname/$bkname"; |
40 |
|
|
@@ -199,10 +199,12 @@ |
41 |
|
|
|
42 |
|
|
if ($deleteearly ne 'true') # Not DeleteEarly so move backup to $setdirname |
43 |
|
|
{ |
44 |
|
|
- if ($incnum == 0) # Create new set directory |
45 |
|
|
+ if ($incnum == 0) # If this is a new set then empty target directory of any .dar files |
46 |
|
|
{ |
47 |
|
|
- &removeTree ($setdirname); |
48 |
|
|
- &createTree ($setdirname); |
49 |
|
|
+ foreach my $file (glob("$setdirname/*.dar")) |
50 |
|
|
+ { |
51 |
|
|
+ unlink $file or ldie("Error deleting old backup files in $setdirname : $!") |
52 |
|
|
+ } |
53 |
|
|
} |
54 |
|
|
foreach (bsd_glob("$mntdir/$id/*.dar")) # Move the backup files to the set directory |
55 |
|
|
{ |