1 |
wellsi |
1.1 |
diff -ruN e-smith-backup-2.2.0.old/root/etc/e-smith/events/actions/workstation-backup-dar e-smith-backup-2.2.0/root/etc/e-smith/events/actions/workstation-backup-dar |
2 |
|
|
--- e-smith-backup-2.2.0.old/root/etc/e-smith/events/actions/workstation-backup-dar 2013-07-06 19:50:52.000000000 -0700 |
3 |
|
|
+++ e-smith-backup-2.2.0/root/etc/e-smith/events/actions/workstation-backup-dar 2013-07-06 20:10:43.000000000 -0700 |
4 |
|
|
@@ -84,6 +84,7 @@ |
5 |
|
|
my $mntdir = $backupwk->prop('Mount') || '/mnt/smb'; |
6 |
|
|
my $frommail = $backupwk->prop('FromMail') || 'admin-backup'; |
7 |
|
|
my $tomail = $backupwk->prop('ToMail') || 'admin'; |
8 |
|
|
+my $deleteearly = $backupwk->prop('DeleteEarly') || 'false'; |
9 |
|
|
my $ether = $internalinterface->prop('Name'); |
10 |
|
|
my $tmpdir; |
11 |
|
|
|
12 |
|
|
@@ -304,15 +305,22 @@ |
13 |
|
|
|
14 |
|
|
# launching dar backup |
15 |
|
|
|
16 |
|
|
-my $rc = run_backup(); |
17 |
|
|
-if ($rc != 0 && $rc != 11) |
18 |
|
|
+if (($deleteearly eq 'true') && (($incnum == 0))) # Allow delete before backup |
19 |
|
|
{ |
20 |
|
|
- ldie("Error while running dar: $rc"); |
21 |
|
|
+ &remove_tree ($setdirname); |
22 |
|
|
+ &create_tree ($setdirname); |
23 |
|
|
} |
24 |
|
|
|
25 |
|
|
-if ($incnum == 0) |
26 |
|
|
+# Perform the actual backup |
27 |
|
|
+my $rc = run_backup(); |
28 |
|
|
+ |
29 |
|
|
+if ($rc != 0 && $rc != 11) |
30 |
|
|
+{ |
31 |
|
|
+ ldie("Error while running dar: $rc"); |
32 |
|
|
+} |
33 |
|
|
+ |
34 |
|
|
+if (($deleteearly ne 'true') && (($incnum == 0))) # Allow delete after backup |
35 |
|
|
{ |
36 |
|
|
- $report .= "Rotating backups in a new set $setdirname. \n"; |
37 |
|
|
&remove_tree ($setdirname); |
38 |
|
|
&create_tree ($setdirname); |
39 |
|
|
} |