1 |
diff -Nur smeserver-affa-3.2.2.3.old/root/etc/affa/sample_SME_SME.conf.sample smeserver-affa-3.2.2.3/root/etc/affa/sample_SME_SME.conf.sample |
2 |
--- smeserver-affa-3.2.2.3.old/root/etc/affa/sample_SME_SME.conf.sample 2015-09-22 22:25:38.000000000 +0200 |
3 |
+++ smeserver-affa-3.2.2.3/root/etc/affa/sample_SME_SME.conf.sample 2016-03-24 20:53:59.000000000 +0100 |
4 |
@@ -19,4 +19,4 @@ |
5 |
weeklyKeep=4 |
6 |
monthlyKeep=12 |
7 |
yearlyKeep=1 |
8 |
-status=enbabled |
9 |
+status=enabled |
10 |
diff -Nur smeserver-affa-3.2.2.3.old/root/etc/affa/sample_SME_usb.conf.sample smeserver-affa-3.2.2.3/root/etc/affa/sample_SME_usb.conf.sample |
11 |
--- smeserver-affa-3.2.2.3.old/root/etc/affa/sample_SME_usb.conf.sample 2015-09-22 22:25:38.000000000 +0200 |
12 |
+++ smeserver-affa-3.2.2.3/root/etc/affa/sample_SME_usb.conf.sample 2016-03-24 20:53:59.000000000 +0100 |
13 |
@@ -22,4 +22,4 @@ |
14 |
weeklyKeep=4 |
15 |
monthlyKeep=12 |
16 |
yearlyKeep=1 |
17 |
-status=enbabled |
18 |
+status=enabled |
19 |
diff -Nur smeserver-affa-3.2.2.3.old/root/etc/e-smith/templates/etc/smb.conf/95Affa smeserver-affa-3.2.2.3/root/etc/e-smith/templates/etc/smb.conf/95Affa |
20 |
--- smeserver-affa-3.2.2.3.old/root/etc/e-smith/templates/etc/smb.conf/95Affa 1970-01-01 01:00:00.000000000 +0100 |
21 |
+++ smeserver-affa-3.2.2.3/root/etc/e-smith/templates/etc/smb.conf/95Affa 2016-03-24 20:53:59.000000000 +0100 |
22 |
@@ -0,0 +1,3 @@ |
23 |
+# WARNING: don't remove the # of the following section! |
24 |
+#[Affa-jobs] |
25 |
+ |
26 |
diff -Nur smeserver-affa-3.2.2.3.old/root/sbin/affa smeserver-affa-3.2.2.3/root/sbin/affa |
27 |
--- smeserver-affa-3.2.2.3.old/root/sbin/affa 2015-09-22 22:25:38.000000000 +0200 |
28 |
+++ smeserver-affa-3.2.2.3/root/sbin/affa 2016-04-22 21:16:37.577000581 +0200 |
29 |
@@ -10,7 +10,7 @@ |
30 |
# This is free software, and you are welcome to redistribute it |
31 |
# under certain conditions; type 'affa --license' for details. |
32 |
#---------------------------------------------------------------------- |
33 |
-my $VERSION='3.2.2.2-0'; |
34 |
+my $VERSION='3.2.2.3-3'; |
35 |
#---------------------------------------------------------------------- |
36 |
|
37 |
use strict; |
38 |
@@ -104,7 +104,9 @@ |
39 |
sub jobsnrpe($); |
40 |
sub logTail(); |
41 |
sub mailTest(); |
42 |
-sub mount($$$); |
43 |
+###### ligne suivante modifiée umount diskusage - bug 9147 |
44 |
+# sub mount($$$); |
45 |
+sub mount($$$%); |
46 |
sub moveArchive(); |
47 |
sub moveFileorDir($$); |
48 |
sub nrpe(); |
49 |
@@ -491,7 +493,9 @@ |
50 |
# mount root dir |
51 |
if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) |
52 |
{ |
53 |
- mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
54 |
+###### ligne suivante modifiée umount diskusage - bug 9147 |
55 |
+# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
56 |
+ mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job ); |
57 |
} |
58 |
|
59 |
affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'}; |
60 |
@@ -934,7 +938,7 @@ |
61 |
############################## ajout modifs |
62 |
$sshQuiet = $job{'Debug'} eq 'yes' ? '' : '-q'; |
63 |
############################# fin modifs |
64 |
-############################################################################################################################################# |
65 |
+############################################################################################################################################### |
66 |
# get Done Dates |
67 |
if( $jobname ) { |
68 |
$job{'_sshOpts'}="-p $job{'sshPort'} -o CheckHostIP=no -o StrictHostKeyChecking=no -o HostKeyAlias=$jobname -o UserKnownHostsFile=/root/.ssh/knownhosts-$jobname" . ($job{'Debug'} ne 'yes' ? ' -q' : ''); |
69 |
@@ -1960,8 +1964,7 @@ |
70 |
} else { |
71 |
# ($h = sprintf "+-%076s-+\n", '-') =~ s/0/-/g; |
72 |
# ligne du patch Affa2 ci dessous |
73 |
- ($h = sprintf "+-%0102s-+\n", '-') =~ s/0/-/g; |
74 |
- |
75 |
+ ($h = sprintf "+-%0110s-+\n", '-') =~ s/0/-/g; |
76 |
} |
77 |
$out2 .= $h; |
78 |
$out = $out.$out2; |
79 |
@@ -1977,6 +1980,15 @@ |
80 |
affaErrorExit( "$txt" ); |
81 |
} |
82 |
my %job=getJobConfig( $jobname ); |
83 |
+ |
84 |
+# automount root dir - fixing bug 9147 |
85 |
+ if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) |
86 |
+ { |
87 |
+ mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job ); |
88 |
+ } |
89 |
+ affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'}; |
90 |
+ |
91 |
+ |
92 |
my @out = ('Archive:Count;Date;Files;Size;RootDirFilesystemAvail;RootDirFilesystemUsed;valid;TotalBytesReceived;ExecutionTime;DedupTotalFiles;DedupReplacedFiles;DedupSavedBytes;DedupExectime;DedupDate'); |
93 |
my %js; |
94 |
my %js2; |
95 |
@@ -2059,6 +2071,12 @@ |
96 |
. ";". $DedupDate |
97 |
); |
98 |
} |
99 |
+ |
100 |
+# auto-unmount - fixing bug 9147 |
101 |
+ my $dev=$job{'AutomountDevice'}; |
102 |
+ my $mountPoint=$job{'AutomountPoint'}; |
103 |
+ unmount($dev,$mountPoint) if $dev and $mountPoint; |
104 |
+ |
105 |
return @out; |
106 |
} |
107 |
|
108 |
@@ -2217,6 +2235,14 @@ |
109 |
next if $jobname eq 'GlobalAffaConfig'; |
110 |
my %job=getJobConfig($jobname); |
111 |
|
112 |
+# automount root dir - fixing bug 9147 |
113 |
+ if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) |
114 |
+ { |
115 |
+ mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job ); |
116 |
+ } |
117 |
+ affaErrorExit("RootDir $job{'RootDir'} does not exist") unless -d $job{'RootDir'}; |
118 |
+ |
119 |
+ |
120 |
my $rptfile=$job{'RootDir'}."/$jobname/scheduled.0/.AFFA3-REPORT"; |
121 |
my $rpt; |
122 |
$rpt= Config::IniFiles->new( -file => $rptfile ) if( -f $rptfile ); |
123 |
@@ -2291,6 +2317,12 @@ |
124 |
my $nof = sprintf "%2d,%2d,%2d,%2d,%2d", $acnt{'scheduled'}, $acnt{'daily'}, $acnt{'weekly'}, $acnt{'monthly'}, $acnt{'yearly'}; |
125 |
push( @out, "$jobname;$status;$lastrun;$netxrun;$TotalFileSize;$avail;$used;$nof;$lock;$state;$BackupTime;$DedupTotalFiles;$DedupReplacedFiles;$DedupSavedBytes;$DedupExectime;$DedupDate"); |
126 |
} |
127 |
+ |
128 |
+ # auto-unmount - fixing bug 9147 |
129 |
+ my $dev=$job{'AutomountDevice'}; |
130 |
+ my $mountPoint=$job{'AutomountPoint'}; |
131 |
+ unmount($dev,$mountPoint) if $dev and $mountPoint; |
132 |
+ |
133 |
return @out; |
134 |
} |
135 |
|
136 |
@@ -2376,7 +2408,9 @@ |
137 |
my $mountPoint = $job{'AutomountPoint'}; |
138 |
my $mountOptions = $job{'AutomountOptions'}; |
139 |
if( $RootDir && $mountPoint && $RootDir =~ /$mountPoint/ ) { |
140 |
- mount($dev,$mountPoint, $mountOptions) if $dev and $mountPoint; |
141 |
+###### ligne suivante modifiée umount diskusage - bug 9147 |
142 |
+# mount($dev,$mountPoint, $mountOptions) if $dev and $mountPoint; |
143 |
+ mount($dev,$mountPoint, $mountOptions, %job) if $dev and $mountPoint; |
144 |
($used, $avail) = df( $RootDir) if isMounted($dev,$mountPoint); |
145 |
unmount($dev,$mountPoint) if $dev and $mountPoint; |
146 |
} elsif( $RootDir && -x $RootDir ) { |
147 |
@@ -2422,8 +2456,11 @@ |
148 |
return $result; |
149 |
} |
150 |
|
151 |
-sub mount($$$) { |
152 |
- (my $dev, my $AutomountPoint, my $options) = @_; |
153 |
+###### 2 lignes suivantes modifiées umount diskusage - bug 9147 |
154 |
+# sub mount($$$) { |
155 |
+# (my $dev, my $AutomountPoint, my $options) = @_; |
156 |
+sub mount($$$%) { |
157 |
+ (my $dev, my $AutomountPoint, my $options, my %job) = @_; |
158 |
$AutomountPoint =~ s/\/$//; |
159 |
return if isMounted( $dev, $AutomountPoint ); |
160 |
File::Path::mkpath( $AutomountPoint, 0, 0700 ) if not -d $AutomountPoint; |
161 |
@@ -2438,9 +2475,10 @@ |
162 |
} |
163 |
} |
164 |
$autoMounted{$AutomountPoint}=$dev if $job{'AutoUnmount'} eq 'yes'; |
165 |
+ |
166 |
} |
167 |
|
168 |
-sub unmount($$) { |
169 |
+ sub unmount($$) { |
170 |
(my $dev, my $AutomountPoint) = @_; |
171 |
$AutomountPoint =~ s/\/$//; |
172 |
return if not $autoMounted{$AutomountPoint} or $autoMounted{$AutomountPoint} ne $dev or not isMounted( $dev, $AutomountPoint ); |
173 |
@@ -2802,7 +2840,9 @@ |
174 |
my %job=getJobConfig( $jobname ); |
175 |
|
176 |
if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) { |
177 |
- mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
178 |
+###### ligne suivante modifiée umount diskusage - bug 9147 |
179 |
+# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
180 |
+ mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job ); |
181 |
} |
182 |
|
183 |
# check if a job is running |
184 |
@@ -2837,7 +2877,7 @@ |
185 |
|
186 |
if ($job{'SMEServer'} ne 'no') |
187 |
{ |
188 |
- print 'SME-server= ' . $job{'SMEServer'} . "\n"; |
189 |
+#pour debbugage print 'SME-server= ' . $job{'SMEServer'} . "\n"; |
190 |
my $prerestore='SME/signal-pre-restore'; |
191 |
if ($job{'remoteHostName'} eq 'localhost') |
192 |
{ |
193 |
@@ -2847,7 +2887,7 @@ |
194 |
{ |
195 |
execJobCommandRemote($jobname,$prerestore); |
196 |
} |
197 |
- print 'pre-restore: $prerestore' . "\n"; |
198 |
+#pour debbugage print 'pre-restore: $prerestore' . "\n"; |
199 |
} |
200 |
|
201 |
|
202 |
@@ -2896,7 +2936,7 @@ |
203 |
################################## penser à rajouter le imapIndexFilesDelete(); cf AffaV2 |
204 |
|
205 |
|
206 |
-print 'SME-server= ' . $job{'SMEServer'} . "\n"; |
207 |
+#pour debbugage print 'SME-server= ' . $job{'SMEServer'} . "\n"; |
208 |
my $postupgrade='SME/signal-post-upgrade-reboot'; |
209 |
if ($job{'remoteHostName'} eq 'localhost') |
210 |
{ |
211 |
@@ -2906,7 +2946,7 @@ |
212 |
{ |
213 |
execJobCommandRemote($jobname,$postupgrade); |
214 |
} |
215 |
- print 'post-upgrade + reboot: $postupgrade' . "\n"; |
216 |
+#pour debbugage print 'post-upgrade + reboot: $postupgrade' . "\n"; |
217 |
|
218 |
} |
219 |
|
220 |
@@ -3359,7 +3399,8 @@ |
221 |
unlink $1; |
222 |
} |
223 |
print FW "$_\n" if not $_ =~ /(include = \/etc\/samba\/Affa-Job|# Affa archives. Updated on)/; |
224 |
- if( $_ =~ /^\[global\]$/i ) { |
225 |
+# ligne d'origine - Bug 9298 - if( $_ =~ /^\[global\]$/i ) { |
226 |
+ if( $_ =~ /^#\[Affa-jobs\]$/i ) { |
227 |
printf FW "# Affa archives. Updated on " .formatHTime(Date::Format::time2str("%Y%m%d%H%M",time())) . "\n"; |
228 |
print FW join("\n", sort keys %inc)."\n"; |
229 |
} |
230 |
@@ -3852,7 +3893,9 @@ |
231 |
|
232 |
if( $job{'AutomountDevice'} and $job{'AutomountPoint'} ) |
233 |
{ |
234 |
- mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
235 |
+###### ligne suivante modifiée umount diskusage - bug 9147 |
236 |
+# mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'} ); |
237 |
+ mount( $job{'AutomountDevice'}, $job{'AutomountPoint'}, $job{'AutomountOptions'}, %job ); |
238 |
} |
239 |
|
240 |
# check if archive exists |
241 |
@@ -4056,7 +4099,8 @@ |
242 |
{ |
243 |
########### $Affa::lib::ExecCmdOutout =~ /(Total file size: [0-9]* bytes)/gm; |
244 |
$ExecCmdOutout =~ /(Total file size: [0-9]* bytes)/gm; |
245 |
- print "OK. $1\n"; |
246 |
+########## print "OK. $1\n"; ##### Bug 9139: valeur de $1 non définie. |
247 |
+ print "OK. \n"; |
248 |
} |
249 |
else |
250 |
{ |