/[smeserver]/rpms/e-smith-backup/sme8/e-smith-backup-2.2.0-workstation-DeleteEarly2.patch
ViewVC logotype

Contents of /rpms/e-smith-backup/sme8/e-smith-backup-2.2.0-workstation-DeleteEarly2.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sun Jul 14 02:56:06 2013 UTC (11 years, 3 months ago) by wellsi
Branch: MAIN
CVS Tags: e-smith-backup-2_2_0-77_el5_sme, e-smith-backup-2_2_0-72_el5_sme, e-smith-backup-2_2_0-78_el5_sme, e-smith-backup-2_2_0-73_el5_sme, e-smith-backup-2_2_0-79_el5_sme, e-smith-backup-2_2_0-85_el5_sme, e-smith-backup-2_2_0-75_el5_sme, e-smith-backup-2_2_0-81_el5_sme, e-smith-backup-2_2_0-76_el5_sme, e-smith-backup-2_2_0-80_el5_sme, e-smith-backup-2_2_0-86_el5_sme, e-smith-backup-2_2_0-83_el5_sme, e-smith-backup-2_2_0-82_el5_sme, e-smith-backup-2_2_0-88_el5_sme, e-smith-backup-2_2_0-74_el5_sme, e-smith-backup-2_2_0-84_el5_sme, e-smith-backup-2_2_0-87_el5_sme, HEAD
* Sat Jul 13 2013 Ian Wells <esmith@wellsi.com> 2.2.0-72.sme
- Workstation Backup, DeleteEarly no longer uses temporary directory [SME: 6811]

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-13 12:47:09.000000000 -0700
3 +++ e-smith-backup-2.2.0/root/etc/e-smith/events/actions/workstation-backup-dar 2013-07-13 13:32:08.000000000 -0700
4 @@ -206,14 +206,6 @@
5 Verify availability of your backup volume. Stopping the backup now.\n")
6 }
7
8 -$tmpdir = $mntdir . '/tmp_dir';
9 -
10 -&remove_tree ("$tmpdir/$id");
11 -&create_tree ("$tmpdir/$id");
12 -
13 -# we know right backup directory is in line and we can write on it.
14 -$report .= "Backup temp directory $tmpdir/$id is mounted and is writable \n";
15 -
16 # rotating backup indicators
17 ++$incnum;
18 $incnum = 0 if ($dow == $fullday && $incnum > $daysinset-7) ||
19 @@ -243,6 +235,20 @@
20 &create_tree ($setdirname);
21 $report .= "Backup directory $id/$setname created \n";
22 }
23 +
24 +if ($deleteearly ne 'true')
25 +{
26 + $tmpdir = $mntdir . '/tmp_dir';
27 +
28 + &remove_tree ("$tmpdir/$id");
29 + &create_tree ("$tmpdir/$id");
30 + $report .= "Backup temp directory $tmpdir/$id is mounted and is writable \n";
31 +}
32 +else
33 +{
34 + $report .= "Backup directory $setdirname is mounted \n";
35 +}
36 +
37
38 if ( $incnum == 0 )
39 {
40 @@ -286,7 +292,6 @@
41 }
42
43 $report .= "Backup base file name is $bkname \n";
44 -$report .= "Making backup in temp directory\n";
45
46 # calculate real timeout if we timeout incrementals only.
47 # timeout of 88500 is a security for aborting backup within 24h
48 @@ -295,7 +300,7 @@
49 {
50 $timeout = 88500;
51 }
52 -$report .= "Using a backup session timeout of : $timeout seconds\n";
53 +$report .= "Starting the backup with a timeout of : $timeout seconds\n";
54
55 # expanding backup configuration file template
56
57 @@ -311,31 +316,32 @@
58 &create_tree ($setdirname);
59 }
60
61 +my $destination = ($deleteearly ne 'true') ? "$tmpdir/$id/$bkname" : "$setdirname/$bkname";
62 +
63 # Perform the actual backup
64 -my $rc = run_backup();
65 +my $rc = run_backup($destination);
66
67 if ($rc != 0 && $rc != 11)
68 {
69 ldie("Error while running dar: $rc");
70 }
71
72 -if (($deleteearly ne 'true') && (($incnum == 0))) # Allow delete after backup
73 +if ($deleteearly ne 'true') # Not DeleteEarly so move backup to $setdirname
74 {
75 - &remove_tree ($setdirname);
76 - &create_tree ($setdirname);
77 -}
78 -
79 -$report .= "Moving backup files to target directory $setdirname \n";
80 -
81 -foreach (bsd_glob("$tmpdir/$id/$bkname*"))
82 -{
83 - ldie("Error while moving backup file $_ from temporary dir $tmpdir/$id to $setdirname : $!")
84 - unless move($_, $setdirname);
85 + $report .= "Moving backup files to target directory $setdirname \n";
86 + if ($incnum == 0)
87 + {
88 + &remove_tree ($setdirname);
89 + &create_tree ($setdirname);
90 + }
91 + foreach (bsd_glob("$tmpdir/$id/$bkname*"))
92 + {
93 + ldie("Error while moving backup file $_ from temporary dir $tmpdir/$id to $setdirname : $!")
94 + unless move($_, $setdirname);
95 + }
96 + &remove_tree ("$tmpdir/$id");
97 }
98
99 -# Remove temporary directory as no longer needed
100 -&remove_tree ("$tmpdir/$id");
101 -
102 # update dar_manager catalog
103 $report .= "Updating catalog\n";
104
105 @@ -515,12 +521,13 @@
106
107 sub run_backup
108 {
109 + my $dest = shift;
110 my $data = undef;
111 my $pid = undef;
112 my $killerpid = undef;
113
114 eval {
115 - ($pid = open INPUT, "-|", "/usr/bin/dar", "-Q", "--create", "$tmpdir/$id/$bkname", split(/\|/,$ref), "-B", "/etc/dar/$job.dcf") or ldie("cannot start : $!" );
116 + ($pid = open INPUT, "-|", "/usr/bin/dar", "-Q", "--create", "$dest", split(/\|/,$ref), "-B", "/etc/dar/$job.dcf") or ldie("cannot start : $!" );
117
118 if ($pid) {
119 $killerpid = start_dar_killer($pid, $timeout); }

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed