/[smeserver]/rpms/smeserver-manager/sme10/smeserver-manager-0.1.2-backup_panels.patch
ViewVC logotype

Annotation of /rpms/smeserver-manager/sme10/smeserver-manager-0.1.2-backup_panels.patch

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


Revision 1.2 - (hide annotations) (download)
Mon Jun 21 15:09:30 2021 UTC (3 years ago) by michel
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
make: « clog » est à jour.

1 michel 1.1 diff -urN smeserver-manager-0.1.2.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body smeserver-manager-0.1.2/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body
2     --- smeserver-manager-0.1.2.old/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2020-11-19 11:53:26.000000000 +0400
3     +++ smeserver-manager-0.1.2/root/etc/e-smith/templates/usr/share/smanager/themes/default/public/css/styles.css/50body 2021-01-25 14:22:59.445000000 +0400
4     @@ -86,6 +86,19 @@
5     margin-bottom:0px;
6     }
7    
8     +.sme-warning {
9     + color: orange;
10     + background-color: #ffffff;
11     + border-width: 1px;
12     + border-style: solid;
13     + border-color: orange ;
14     + padding: 4px;
15     + margin-left: 20px;
16     + margin-right: 20px;
17     + margin-top:2px;
18     + margin-bottom:2px;
19     +}
20     +
21     #footer img {
22     float: right;
23     position: fixed;
24     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Backup.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Backup.pm
25     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Backup.pm 2020-11-19 11:53:26.000000000 +0400
26     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Backup.pm 2021-01-27 21:37:34.462000000 +0400
27     @@ -8,9 +8,16 @@
28     #----------------------------------------------------------------------
29     # routes : end
30    
31     +# for information - routes
32     +# $if_admin->get('/backup')->to('backup#main')->name('backup');
33     +# $if_admin->post('/backup')->to('backup#do_display')->name('backupd');
34     +# $if_admin->get('/backupd')->to('backup#do_display')->name('backupc');
35     +# $if_admin->post('/backupd')->to('backup#do_update')->name('backupu');
36     +
37     use strict;
38     use warnings;
39     use Mojo::Base 'Mojolicious::Controller';
40     +use utf8;
41    
42     use Locale::gettext;
43     use SrvMngr::I18N;
44     @@ -27,26 +34,16 @@
45    
46     use esmith::Backup;
47     use esmith::BackupHistoryDB;
48     -use esmith::cgi;
49     use esmith::util;
50     use esmith::lockfile;
51    
52     +use constant DEBUG => $ENV{MOJO_SMANAGER_DEBUG} || 0;
53     +
54     our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
55     our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
56     our $rdb = esmith::ConfigDB->open('/etc/e-smith/restore')
57     || die "Couldn't open restore db";
58    
59     -
60     -#$File::Find::dont_use_nlink = 1; # fix for Windows shares
61     -
62     -# These statements _must_ come _after_ the FormMagick constructor. It sets
63     -# POST_MAX and DISABLE_UPLOADS to values that will cause this script to fail
64     -# on restores and verification of files.
65     -##$CGI::POST_MAX = -1; # allow any size POST
66     -##$CGI::DISABLE_UPLOADS = 0; # need to upload to restore from desktop
67     -
68     -#$fm->parse_xml();
69     -
70     my $es_backup = new esmith::Backup or die "Couldn't create Backup object\n";
71    
72     my @directories = $es_backup->restore_list;
73     @@ -91,12 +88,12 @@
74     $bac_datas{'module'} = $module;
75    
76     if ($tarsize =~ /Tb/ or $tarsize =~ /(\d+)Gb/ and $1 >= 2) {
77     - $notif = $c->l("bac_BACKUP_DESKTOP_TOO_BIG");
78     + $notif = $c->l("bac_BACKUP_DESKTOP_TOO_BIG").' : '.$tarsize;
79     }
80    
81     my $rec = $cdb->get('backup');
82     my ($backup_status, $backupwk_status) = 'disabled';
83     -
84     +
85     if ($rec) {
86     $backup_status = $rec->prop('status') || 'disabled';
87     }
88     @@ -113,13 +110,13 @@
89    
90     if ($backupwk_status eq "enabled") {
91     $bac_datas{'backupwkTime'} = $rec->prop('BackupTime');
92     -
93     }
94    
95     $bac_datas{'backupStatus'} = $backup_status;
96     $bac_datas{'backupwkStatus'} = $backupwk_status;
97    
98     - $c->stash( title => $title, notif => $notif, bac_datas => \%bac_datas );
99     + $c->stash( warning => $notif ) if ( $notif );
100     + $c->stash( title => $title, bac_datas => \%bac_datas );
101     $c->render(template => 'backup');
102    
103     };
104     @@ -144,23 +141,24 @@
105     $function = undef;
106     }
107    
108     + DEBUG && warn("do_display $function");
109     +
110     my %bac_datas = ();
111     $bac_datas{'function'} = $function;
112    
113     my $title = $c->l('bac_BACKUP_TITLE');
114     - my ($notif, $dest) = '';
115     + my $dest = '';
116     +
117    
118     if ( $function eq 'desktop_backup' ) {
119     - my $res = desktopBackup();
120     - $result .= $res unless $res eq 'OK';
121     - if ( ! $result ) {
122     - $result = $c->l('bac_SUCCESS');
123     - $c->app->log->info('desktop backup LAUNCHED');
124     - $c->flash(success => $result);
125     - } else {
126     - $c->stash(error => $result);
127     - }
128     - $c->redirect_to("backup");
129     +
130     + my $CompressionLevel = $cdb->get_prop("backupconsole", "CompressionLevel") || "-6";
131     + my @exclude = map (" --exclude=$_",@backup_excludes);
132     +
133     + $c->stash( compressionlevel => $CompressionLevel, exclude => \@exclude, directories => \@directories );
134     +
135     + # streaming download in template
136     + return $c->render("/backdown");
137     }
138    
139    
140     @@ -207,13 +205,102 @@
141     my $rec = $cdb->get('backupwk');
142     $bac_datas{vfstype} = $rec->prop('VFSType') || 'cifs';
143     $bac_datas{status} = $rec->prop('status');
144     + }
145     +
146     +
147     + if ( $function eq 'workstn_configure1' ) {
148     +
149     + $bac_datas{vfstype} = $c->param('VFSType');
150     + $bac_datas{'status'} = '';
151     + $bac_datas{ampm} = 'AM';
152     + $bac_datas{min} = '';
153     + $bac_datas{hour} = '';
154     + $bac_datas{login} = 'backup';
155     + $bac_datas{password} = 'backup';
156     + $bac_datas{station} = 'host';
157     + $bac_datas{folder} = 'share';
158     + $bac_datas{mount} = '';
159     + $bac_datas{setsNumber} = '';
160     + $bac_datas{filesinset} = '';
161     + $bac_datas{timeout} = '';
162     + $bac_datas{incOnlyTimeout} = '';
163     + $bac_datas{compression} = '';
164     + $bac_datas{dof} = '';
165     +
166     + # Obtain backup informations from configuration
167     + my $rec = $cdb->get('backupwk');
168     + my $Time = '2:00';
169     + if ($rec) {
170     + $Time = $rec->prop('BackupTime') || '2:00';
171     + $bac_datas{login} = $rec->prop('Login') || 'backup';
172     + $bac_datas{password} = $rec->prop('Password') || 'backup';
173     + $bac_datas{station} = $rec->prop('SmbHost') || 'host';
174     + $bac_datas{folder} = $rec->prop('SmbShare') || 'share';
175     + $bac_datas{mount} = $rec->prop('Mount') || '';
176     + $bac_datas{setsNumber} = $rec->prop('SetsMax') || '1';
177     + $bac_datas{filesinset} = $rec->prop('DaysInSet') || '1';
178     + $bac_datas{timeout} = $rec->prop('Timeout') || '12';
179     + $bac_datas{incOnlyTimeout} = $rec->prop('IncOnlyTimeout') || 'yes';
180     + $bac_datas{compression} = $rec->prop('Compression') || '0';
181     + $bac_datas{dof} = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7';
182     + }
183     +
184     + ($bac_datas{hour}, $bac_datas{min}) = split (':', $Time, -1);
185     + if ( $bac_datas{hour} > 12 ) {
186     + $bac_datas{hour} -= 12;
187     + $bac_datas{ampm} = 'PM';
188     + }
189    
190     + my $backupwk_status;
191     + if ($rec) {
192     + $backupwk_status = $rec->prop('status');
193     + }
194     +
195     + if (defined $backupwk_status && $backupwk_status eq 'enabled') {
196     + $bac_datas{status} = 'checked';
197     + }
198     +
199     + if (defined $bac_datas{incOnlyTimeout} && $bac_datas{incOnlyTimeout} eq 'yes') {
200     + $bac_datas{incOnlyTimeout} = 'checked';
201     + }
202     }
203     -
204     +
205     +
206     + if ( $function eq 'workstn_verify' ) {
207     +
208     + my $rec = $cdb->get('backupwk');
209     + if ( $rec) {
210     + $bac_datas{status} = $rec->prop('status') || 'disabled';
211     + }
212     + }
213     +
214     +
215     + if ( $function eq 'workstn_verify1' ) {
216     +
217     + $res = '';
218     + if ( ! $result ) {
219     + $res = $c->workstnVerify(); # list returned
220     + $bac_datas{function} = $function;
221     + $bac_datas{files_list} = $res;
222     + }
223     +
224     + }
225     +
226     +
227     + if ( $function eq 'workstn_restore' ) {
228     +
229     + my $rec = $cdb->get('backupwk');
230     + if ( $rec) {
231     + $bac_datas{status} = $rec->prop('status') || 'disabled';
232     + }
233     + }
234     +
235    
236     $dest = "back_$function";
237    
238     - $c->stash( title => $title, notif => $result, bac_datas => \%bac_datas );
239     + $c->stash( error => $result );
240     +
241     + $c->stash( title => $title, bac_datas => \%bac_datas );
242     return $c->render( template => $dest );
243    
244     };
245     @@ -227,23 +314,18 @@
246     my $rt = $c->current_route;
247     my $function = $c->param('Function');
248    
249     + DEBUG && warn("do_update $function");
250     +
251     my %bac_datas = ();
252     +
253     $bac_datas{function} = $function;
254     my $title = $c->l('bac_BACKUP_TITLE');
255     my ($dest, $res, $result) = '';
256    
257    
258     if ( $function eq 'desktop_backup' ) {
259     -
260     # should not happen !! no desktop_backup template !!
261     -
262     - $res = desktopBackup();
263     - $result .= $res unless $res eq 'OK';
264     - if ( ! $result ) {
265     - $result = $c->l('bac_SUCCESS');
266     - $c->stash( notif => $result );
267     - $c->redirect_to("/backup");
268     - }
269     + $result .= ' ** Function error for desktop backup ** !';
270     }
271    
272    
273     @@ -257,8 +339,6 @@
274     my $reminderMin = $c->param('ReminderMin');
275     my $rampm = $c->param('ReminderAMPM');
276    
277     - ## $c->l('bac_UPDATING_TAPE_CONF')
278     -
279     if (defined $status && $status eq "on") {
280    
281     if ($backupHour =~ /^(.*)$/) {
282     @@ -300,9 +380,7 @@
283     $result .= $c->l('bac_ERR_INVALID_REMINDER_MINUTE').$reminderMin.
284     ' '.$c->l('bac_BETWEEN_0_AND_59').' ';
285     }
286     - }
287     - else
288     - {
289     + } else {
290     # service disabled no controls
291     }
292    
293     @@ -310,7 +388,7 @@
294    
295     $res = '';
296     if ( ! $result ) {
297     - $res = $c->updateTapeBackupConfig($status, $backupHour,
298     + $res = $c->tapeBackupConfig($status, $backupHour,
299     $backupMin, $bampm, $reminderHour, $reminderMin, $rampm);
300    
301     $result .= $res unless $res eq 'OK';
302     @@ -322,6 +400,7 @@
303     } else {
304     $result .= $c->l('bac_SUCCESSFULLY_DISABLED');
305     }
306     + $cdb->reload;
307     }
308     }
309     }
310     @@ -334,38 +413,39 @@
311    
312     unless ($file_handle) {
313     $result .= $c->l('bac_UNABLE_TO_RESTORE_CONF').' '.
314     - $c->l('ANOTHER_RESTORE_IN_PROGRESS');
315     + $c->l('bac_ANOTHER_RESTORE_IN_PROGRESS');
316     }
317    
318     - $result .= ' ** Blocked for testing ** ! (HARD TO TEST!)';
319     + ##$result .= ' ** Blocked for testing ** !';
320    
321     $res = '';
322     if ( ! $result ) {
323     $res = $c->tapeRestore( $lock_file, $file_handle );
324     $result .= $res unless $res eq 'OK';
325     - if ( ! $result ) {
326     - $result = $c->l('bac_SUCCESS');
327     - }
328     + #if ( ! $result ) {
329     + #$result = $c->l('bac_SUCCESS');
330     + #}
331     }
332     }
333    
334    
335     if ( $function eq 'workstn_configure' ) {
336    
337     -# $bac_datas{xxx} = $c->param('XXX');
338     + # should not happen !!
339     + $result .= ' ** Function error for workstation configure *** !';
340     + }
341     +
342    
343     - # controls
344     -# $res = $c->zzzz( $c->param('ZZZZ') );
345     -# $result .= $res . ' DMS ' unless $res eq 'OK';
346     + if ( $function eq 'workstn_configure1' ) {
347    
348     - $result .= ' ** Blocked for testing ** !';
349     + #$result .= ' ** Blocked for testing ** !';
350    
351     $res = '';
352     if ( ! $result ) {
353     - $res = $c->workstnConfigure();
354     - $result .= $res unless $res eq 'OK';
355     - if ( ! $result ) {
356     - $result = $c->l('bac_SUCCESS');
357     + $res = $c->updateWorkstnBackupConfig();
358     + if ( ($result = $res) =~ s|^#OK#|| ) {
359     + $res = 'OK';
360     + $cdb->reload;
361     }
362     }
363     }
364     @@ -373,181 +453,154 @@
365    
366     if ( $function eq 'workstn_verify' ) {
367    
368     -# $bac_datas{xxx} = $c->param('XXX');
369     + # should not happen !!
370     + $result .= ' ** Function error for workstation verify *** !';
371     + }
372     +
373    
374     - # controls
375     -# $res = $c->zzzz( $c->param('ZZZZ') );
376     -# $result .= $res . ' DMS ' unless $res eq 'OK';
377     + if ( $function eq 'workstn_verify1' ) {
378    
379     - $result .= ' ** Blocked for testing ** !';
380     + ##$result .= ' ** Blocked for testing ** !';
381    
382     - $res = '';
383     - if ( ! $result ) {
384     - $res = $c->workstnVerify();
385     - $result .= $res unless $res eq 'OK';
386     - if ( ! $result ) {
387     - $result = $c->l('bac_SUCCESS');
388     - }
389     - }
390     + $res = 'OK';
391     + $result = '';
392     }
393    
394    
395     if ( $function eq 'workstn_restore' ) {
396    
397     -# $bac_datas{xxx} = $c->param('XXX');
398     -
399     - # controls
400     -# $res = $c->zzzz( $c->param('ZZZZ') );
401     -# $result .= $res . ' DMS ' unless $res eq 'OK';
402     -
403     - $result .= ' ** Blocked for testing ** !';
404     + ##$result .= ' ** Blocked for testing ** !';
405    
406     + $res = 'NOK';
407     if ( ! $result ) {
408     $res = $c->workstnRestore();
409     - $result .= $res unless $res eq 'OK';
410     - if ( ! $result ) {
411     - $result = $c->l('bac_SUCCESS');
412     + if ( ($result = $res) =~ s|^#OK#|| ) {
413     + $bac_datas{restore_log} = $result;
414     + $res = 'OK';
415     + } else {
416     + $c->stash( error => $result );
417     }
418     + $bac_datas{function} = 'workstn_restore1';
419     + $res = 'NEXT';
420     }
421     }
422    
423    
424     - if ( $function eq 'workstn_sel_restore' ) {
425     -
426     -# $bac_datas{xxx} = $c->param('XXX');
427     + if ( $function eq 'workstn_restore1' ) {
428    
429     - # controls
430     -# $res = $c->zzzz( $c->param('ZZZZ') );
431     -# $result .= $res . ' DMS ' unless $res eq 'OK';
432     + my $state = 'unknown';
433     + my $rec = $rdb->get('restore');
434     + if ($rec) {
435     + $state = $rec->prop('state') || 'unknown';
436     + }
437    
438     - $result .= ' ** Blocked for testing ** !';
439     + $result .= "Restore state unexpected: $state" if ($state ne 'complete');
440    
441     - $res = '';
442     + $res = 'NOK';
443     if ( ! $result ) {
444     - $res = $c->workstnSelRestore();
445     - $result .= $res unless $res eq 'OK';
446     - if ( ! $result ) {
447     - $result = $c->l('bac_SUCCESS');
448     + $res = $c->performReboot();
449     + if ( ($result = $res) =~ s|^#OK#|| ) {
450     + $res = 'OK';
451     + } else {
452     + $c->stash( error => $result );
453     }
454     }
455     }
456    
457     - # common part for all functions
458    
459     - if ($res ne 'OK') {
460     - $c->stash( error => $result );
461     - $c->stash( title => $title, bac_datas => \%bac_datas );
462     - my $dest = "back_$function";
463     - return $c->render($dest);
464     - }
465     + if ( $function eq 'workstn_sel_restore' ) {
466    
467     - my $message = "'Backup' $function updates DONE";
468     - $c->app->log->info($message);
469     - $c->flash(success => $result);
470     -
471     - $c->redirect_to('backup');
472     + my $backupset = $c->param('Backupset');
473     + my $filterexp = $c->param('Filterexp');
474     + if ($filterexp =~ /^(.*)$/) {
475     + $filterexp = $1;
476     + } else {
477     + $filterexp = '';
478     + }
479    
480     -};
481     + #$result .= ' ** Blocked for testing 1 ** !';
482    
483     + $res = '';
484     + if ( ! $result ) {
485     + $bac_datas{function} = 'workstn_sel_restore1';
486     + $bac_datas{backupset} = $backupset;
487     + $bac_datas{filterexp} = $filterexp;
488     + $res = 'NEXT';
489     + }
490     + }
491    
492     -sub get_function_options {
493    
494     - my $c = shift;
495     + if ( $function eq 'workstn_sel_restore1' ) {
496    
497     - return [[ $c->l('bac_DESKTOP_BACKUP') => 'desktop_backup' ],
498     - [ $c->l('bac_TAPE_CONFIGURE') => 'tape_configure' ],
499     - [ $c->l('bac_TAPE_RESTORE') => 'tape_restore' ],
500     - [ $c->l('bac_WORKSTN_CONFIGURE') => 'workstn_configure' ],
501     - [ $c->l('bac_WORKSTN_VERIFY') => 'workstn_verify' ],
502     - [ $c->l('bac_WORKSTN_RESTORE') => 'workstn_restore' ],
503     - [ $c->l('bac_WORKSTN_SEL_RESTORE') => 'workstn_sel_restore']];
504     + $bac_datas{backupset} = $c->param('Backupset');
505     + $bac_datas{filterexp} = $c->param('Filterexp');
506    
507     -}
508     + my @restorefiles = @{$c->every_param('Restorefiles')};
509    
510     + my $seldatebefore = $c->param('Seldatebefore');
511     + if ($seldatebefore =~ /^(.*)$/) {
512     + $seldatebefore = $1;
513     + } else {
514     + $result .= 'Unsecure data : ' . $seldatebefore;
515     + }
516    
517     -sub desktopBackup {
518     + my $tymd =
519     + qr/((19|20)\d\d\/(?=\d\d\/\d\d-))?((0?[1-9]|1[0-2])\/(?=\d\d-))?((31|[123]0|[012]?[1-9])-)?/;
520     + my $thms =
521     + qr/([01]?[0-9]|2[0-3]):([0-5][0-9])(:[0-5][0-9])?/;
522    
523     - my $c = shift;
524     + $result .= " $seldatebefore : " . $c->l('bac_ERR_INVALID_SELDATE')
525     + unless (($seldatebefore =~ m/^$tymd$thms$/) || ($seldatebefore eq ""));
526    
527     - # Generate a header that will trigger a download and send data as
528     - # an octet stream.
529     + ##$result .= ' ** Blocked for testing 2 ** !';
530    
531     - my $backups = esmith::BackupHistoryDB->open;
532     - my $now = time();
533     - my $backup_rec = $backups->new_record($now, {
534     - type => 'backup_record',
535     - BackupType => 'desktop',
536     - StartEpochTime => $now,
537     - });
538     - my $CompressionLevel = $cdb->get_prop("backupconsole", "CompressionLevel") || "-6";
539     - my @exclude = map (" --exclude=$_",@backup_excludes);
540     -
541     - # Dump the current mysql tables so that they are part of the image.
542     - # The events handle cases where mysqld is not enabled, and/or is
543     - # not running.
544     + $res = '';
545     + if ( ! $result ) {
546     + $res = $c->performWorkstnSelRestore( $seldatebefore, \@restorefiles ); # restore log returned
547     + if ( ($result = $res) =~ s|^#OK#|| ) {
548     + $bac_datas{restore_log} = $result;
549     + $res = 'OK';
550     + } else {
551     + $c->stash( error => $result );
552     + }
553     + $bac_datas{function} = 'workstn_sel_restore2';
554     + $res = 'NEXT';
555     + }
556     + }
557    
558     - my $status = system("/sbin/e-smith/signal-event", "pre-backup", "desktop");
559     - if ($status)
560     - {
561     - desktopBackupRecordStatus($backup_rec, 'pre-backup', $status);
562     - return ($c->l('bac_OPERATION_STATUS_REPORT').
563     - $c->l('bac_ERR_PRE_BACKUP'));
564     - }
565     -
566     - print "Expires: 0\n";
567     - print "Content-type: application/octet-stream\n";
568     - print "Content-disposition: attachment; filename=smeserver.tgz\n";
569     - print "\n";
570     - setpgrp;
571     - my $ourpgrp = getpgrp;
572     - local $SIG{PIPE} = sub
573     - {
574     - local $SIG{HUP} = 'IGNORE';
575     - warn "Got sigpipe - sending HUP to $ourpgrp\n";
576     - kill HUP => -$ourpgrp;
577     - desktopBackupRecordStatus($backup_rec,
578     - 'send2browser', 'Incomplete');
579     - exit 1;
580     - };
581     -
582     - open(RD,
583     - "/bin/tar --directory / --create @directories --file=-"
584     - . "@exclude | /usr/bin/gzip $CompressionLevel |"
585     - );
586    
587     - while (<RD>)
588     - {
589     - print;
590     - }
591     + if ( $function eq 'workstn_sel_restore2' ) {
592    
593     - close RD;
594     + ##$result .= ' ** Blocked for testing 3 ** !';
595    
596     - # Remove the dumped tables.
597     + $res = 'OK';
598     + $result = '';
599     + }
600    
601     - $status = system("/sbin/e-smith/signal-event", "post-backup", "desktop");
602     - if ($status)
603     - {
604     - desktopBackupRecordStatus($backup_rec, 'post-backup', $status);
605     - die ($c->l('bac_ERR_POST_BACKUP'),"\n");
606     +
607     + # common part for all functions
608     + if ($res ne 'OK') {
609     + if ($res eq 'NEXT') {
610     + $dest = 'back_' . $bac_datas{"function"};
611     + } else {
612     + $c->stash( error => $result );
613     + $dest = "back_$function";
614     + }
615     + $c->stash( title => $title, bac_datas => \%bac_datas );
616     + return $c->render($dest);
617     }
618     - $now = time();
619     - $backup_rec->set_prop('EndEpochTime', "$now");
620     - $backup_rec->set_prop('Result', "0");
621     -}
622    
623    
624     -sub desktopBackupRecordStatus {
625     + my $message = "'Backup' $function updates DONE";
626     + $c->app->log->info($message);
627     + $c->flash(success => $result);
628    
629     - my ($backup, $phase, $status) = @_;
630     - my $now = time();
631     + $c->redirect_to('backup');
632    
633     - warn("Backup terminated: $phase failed - status: $status\n");
634     - $backup->set_prop('EndEpochTime', "$now");
635     - $backup->set_prop('Result', "$phase:$status");
636     -}
637     +};
638    
639    
640     -sub updateTapeBackupConfig {
641     +sub tapeBackupConfig {
642    
643     my ($c, $status, $backupHour, $backupMin, $bampm,
644     $reminderHour, $reminderMin, $rampm) = @_;
645     @@ -584,8 +637,7 @@
646     my $oldUnsav = $cdb->get('UnsavedChanges')->value;
647    
648     my $rec = $cdb->get('backup');
649     - unless (defined $rec)
650     - {
651     + unless (defined $rec) {
652     $rec = $cdb->new_record('backup', {type=>'service'});
653     }
654    
655     @@ -611,15 +663,12 @@
656     or return ($c->l('bac_ERR_CONF_BACKUP'),"\n");
657    
658     return 'OK';
659     - }
660     - else
661     - {
662     + } else {
663     # set service to disabled
664     my $oldUnsav = $cdb->get('UnsavedChanges')->value;
665    
666     my $rec = $cdb->get('backup');
667     - unless ($rec)
668     - {
669     + unless ($rec) {
670     $rec = $cdb->new_record('backup', {type=>'service'});
671     }
672    
673     @@ -631,11 +680,1161 @@
674    
675     return 'OK';
676     }
677     -
678     return undef;
679     }
680    
681    
682     +sub tapeRestore {
683     +
684     + my ($c, $lock_file, $file_handle) = @_;
685     +
686     + my $rec = $rdb->get('restore');
687     + $rec->set_prop('state', 'running');
688     + $rec->set_prop('start', time);
689     +
690     + my $child;
691     +
692     + if ($child = fork) {
693     + # Parent
694     + $SIG{'CHLD'} = 'IGNORE';
695     + &esmith::lockfile::UnlockFile($file_handle);
696     + return 'OK';
697     + } elsif (defined $child) {
698     + # Child
699     + # Re-establish the lock. Wait till it is relinquished by the parent.
700     +
701     + $file_handle = &esmith::lockfile::LockFileOrWait($lock_file);
702     +
703     + # Close STDOUT so that the web server connection is closed.
704     + close STDOUT;
705     +
706     + # Now reopen STDOUT for the child. Redirect it to STDERR.
707     + open(STDOUT, ">&STDERR");
708     +
709     + unless(system("/sbin/e-smith/signal-event", "pre-restore") == 0) {
710     + $rec->set_prop('errmsg', $c->l('bac_ERR_PRE_RESTORE'));
711     + $rec->delete_prop('state');
712     + die ($c->l('bac_ERR_PRE_RESTORE'),"\n");
713     + }
714     +
715     + unless(system("/sbin/e-smith/signal-event", "restore-tape") == 0) {
716     + $rec->set_prop('errmsg', $c->l('bac_ERR_RESTORING_FROM_TAPE'));
717     + $rec->delete_prop('state');
718     + die ($c->l('bac_ERR_RESTORING_FROM_TAPE')."\n");
719     + }
720     +
721     + #----------------------------------------
722     + # regenerate configuration files
723     + #----------------------------------------
724     + unless(system("/usr/sbin/groupmod", "-g", "$www_gid", "www") == 0) {
725     + $rec->set_prop('errmsg', $rec->prop('errmsg').', '.
726     + $c->l('bac_ERR_RESTORING_GID'));
727     + warn ($c->l('bac_ERR_RESTORING_GID')."\n");
728     + }
729     + unless(system("/usr/sbin/usermod", "-g", "$www_gid", "www") == 0) {
730     + $rec->set_prop('errmsg', $rec->prop('errmsg').', '.
731     + $c->l('bac_ERR_RESTORING_INITIAL_GRP'));
732     + warn ($c->l('bac_ERR_RESTORING_INITIAL_GRP')."\n");
733     + }
734     + esmith::util::backgroundCommand(0,
735     + "/sbin/e-smith/signal-event", "post-upgrade");
736     + #unless(system("/sbin/e-smith/signal-event", "post-upgrade") == 0) {
737     + # $rec->set_prop('errmsg', $rec->prop('errmsg').', '.
738     + # $c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
739     + # $rec->delete_prop('state');
740     + # die ($c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
741     + #}
742     +
743     + my $finish = time;
744     + $rec->set_prop('state', 'complete');
745     + $rec->set_prop('finish', $finish);
746     +
747     + my $start = $rec->prop('start');
748     + $start = scalar localtime($start);
749     + $finish = scalar localtime($finish);
750     +
751     + &esmith::lockfile::UnlockFile($file_handle);
752     +
753     + exit;
754     + } else {
755     + # Error
756     + $rec->delete_prop('state');
757     + $rec->set_prop('errmsg', $c->l('bac_COULD_NOT_FORK'));
758     + die ($c->l("bac_COULD_NOT_FORK")." $!\n");
759     + }
760     +}
761     +
762     +
763     +sub workstnBackupConfig {
764     +
765     + # called by template
766     + my ($c) = @_;
767     + my $out;
768     +
769     + my $backupwk_status;
770     + my $enabledIncOnlyTimeout = "";
771     + my $backupwkLogin = 'backup';
772     + my $backupwkPassword = 'backup';
773     + my $backupwkStation = 'host';
774     + my $backupwkFolder = 'share';
775     + my $backupwkMount = '/mnt/smb';
776     + my $setsNumber;
777     + my $filesinset;
778     + my $backupwkTime;
779     + my $backupwkTimeout;
780     + my $backupwkIncOnlyTimeout;
781     + my $VFSType;
782     + my $compression;
783     + my $dof;
784     + my @dlabels = split(' ', $c->l('bac_DOW'));
785     +
786     + # Obtain backup informations from configuration
787     + my $rec = $cdb->get('backupwk');
788     + if ($rec) {
789     + $backupwkTime = $rec->prop('BackupTime') || '2:00';
790     + $backupwkLogin = $rec->prop('Login') || 'backup';
791     + $backupwkPassword = $rec->prop('Password') || 'backup';
792     + $backupwkStation = $rec->prop('SmbHost') || 'host';
793     + $backupwkFolder = $rec->prop('SmbShare') || 'share';
794     + $backupwkMount = $rec->prop('Mount') || '/mnt/smb';
795     + $VFSType = $rec->prop('VFSType') || 'cifs';
796     + $setsNumber = $rec->prop('SetsMax') || '1';
797     + $filesinset = $rec->prop('DaysInSet') || '1';
798     + $backupwkTimeout = $rec->prop('Timeout') || '12';
799     + $backupwkIncOnlyTimeout = $rec->prop('IncOnlyTimeout') || 'yes';
800     + $compression = $rec->prop('Compression') || '0';
801     + $dof = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7';
802     + $backupwk_status = $rec->prop('status');
803     + }
804     +
805     + if ($rec) {
806     + if ($VFSType eq 'usb') {
807     + $out .= $c->l('bac_WORKSTN_BACKUP_USB').' '.$backupwkFolder.'<br/>';
808     + } elsif ($VFSType eq 'mnt') {
809     + $out .= $c->l('bac_WORKSTN_BACKUP_MNT').' '.$backupwkMount.'<br/>';
810     + } else {
811     + $out .= $c->l('bac_WORKSTN_BACKUP_HOST').' '.$backupwkStation.' ';
812     + $out .= $c->l('bac_WORKSTN_BACKUP_VFSTYPE').' '.$VFSType.'<br/>';
813     + $out .= $c->l('bac_WORKSTN_BACKUP_SHARE').' '.$backupwkFolder.'<br/>';
814     + }
815     + if ($VFSType eq 'cifs') {
816     + $out .= $c->l('bac_LOGIN').' '.$backupwkLogin.'<br/>';
817     + $out .= $c->l('PASSWORD').' ********<br/>';
818     + }
819     + $out .= $c->l('bac_WORKSTN_BACKUP_SETSNUM').' '.$setsNumber.'<br/>';
820     + $out .= $c->l('bac_WORKSTN_BACKUP_DAYSINSET').' '.$filesinset.'<br/>';
821     + $out .= $c->l('bac_WORKSTN_BACKUP_COMPRESSION').' '.$compression.'<br/>';
822     + $out .= $c->l('bac_WORKSTN_BACKUP_TOD').' '.$backupwkTime.'<br/>';
823     + $out .= $c->l('bac_WORKSTN_BACKUP_TIMEOUT').' '.$backupwkTimeout.' '.$c->l('bac_HOURS');
824     +
825     + if ( $backupwkIncOnlyTimeout eq 'yes' ) {
826     + $out .= $c->l('bac_WORKSTN_BACKUP_INCONLY_TIMEOUT')
827     + }
828     + $out .= '<br/>';
829     +
830     + if ( $dof eq '7' ) {
831     + $out .= $c->l('bac_WORKSTN_FULL_BACKUP_EVERYDAY').'<br/>';
832     + } else {
833     + $out .= $c->l('bac_WORKSTN_FULL_BACKUP_DAY').' '.$dlabels[$dof].'<br/>';
834     + }
835     + } else {
836     + $out = $c->l('bac_WORKSTN_BACKUP_NOT_CONFIGURED');
837     + }
838     + return $out;
839     +}
840     +
841     +
842     +sub workstnVerify {
843     +
844     + my ($c) = @_;
845     + my $out;
846     +
847     + my $backupwkrec = $cdb->get('backupwk');
848     + my $smbhost = $backupwkrec->prop('SmbHost');
849     + my $smbshare = $backupwkrec->prop('SmbShare');
850     + my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb';
851     + my $key;
852     + my $error_message;
853     + my $id = $backupwkrec->prop('Id') ||
854     + $cdb->get('SystemName')->value .'.'. $cdb->get('DomainName')->value;
855     + my $err;
856     + my $VFSType = $backupwkrec->prop('VFSType') || 'cifs';
857     + my $verifyref = $c->param ('Backupset');
858     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
859     +
860     + # Mounting backup shared folder
861     + $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
862     + if ($error_message) {
863     + return $error_message .' '. $id;
864     + }
865     +
866     + # Test if backup subdirectory for our server
867     + my $mntbkdir = $mntdir . "/$id";
868     + unless (-d $mntbkdir) {
869     + $error_message = $c->l('bac_ERR_NO_HOST_DIR')."\n";
870     + $error_message .= $c->bunmount($mntdir,$VFSType);
871     + return $error_message .' '. $id;
872     + }
873     +
874     + my $fullverify = $c->param('Verifyall') || '';
875     +
876     + if ( $fullverify eq "on" ) {
877     + # Test all backups needed to full restore
878     + my %backupsetfiles = ();
879     + my @restorefiles;
880     + my $set = $verifyref;
881     + $set =~ s/\/[^\/]*$//;
882     + my $backupsetlist = sub {
883     + if ( $_ =~ /\.dar/ ) {
884     + my $backupref = $File::Find::name;
885     + $backupref =~ s/\.[0-9]+\.dar//;
886     + $_ =~ s/\..*\.dar//;
887     + $_ =~ s/.*-//;
888     + $backupsetfiles{$_} = $backupref;
889     + }
890     + };
891     + # find list of available backups and verify
892     + # it contains all backups needed for full restore
893     +
894     + find { wanted => \&$backupsetlist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$| }, $set ;
895     +
896     + my $key;
897     + my $num = 0;
898     + foreach $key (sort keys %backupsetfiles)
899     + {
900     + push @restorefiles, $backupsetfiles{$key};
901     + if ( $num == 0 ) {
902     + unless ( $backupsetfiles{$key} =~ /\/full-/ ) {
903     + $out .= $c->l('bac_ERR_NO_FULL_BACKUP');
904     + return $out;
905     + }
906     + } else {
907     + my $numf = sprintf("%03d", $num);
908     + unless ( $backupsetfiles{$key} =~ /\/inc-$numf-/ ) {
909     + $out .= $c->l('bac_ERR_NO_INC_BACKUP') . " " . $numf;
910     + return $out;
911     + }
912     + }
913     + $num++;
914     + last if ( $backupsetfiles{$key} eq $verifyref );
915     + }
916     +
917     + if (open(RD, "-|")) {
918     +
919     + $out .= '<b>'.$c->l('bac_TESTING_NEEDED_BACKUPS_FOR_RESTORE').'</b><UL>';
920     + while (<RD>) {
921     + $out .= "<li>$_</li>";
922     + }
923     + $out .= '</UL>';
924     +
925     + my $message;
926     + $out .= '<b>';
927     + if (!close RD) {
928     + $out .= $c->l('bac_RESTORE_VERIFY_FAILED');
929     + } else {
930     + $out .= $c->l('bac_VERIFY_COMPLETE');
931     + }
932     + $out .= '</b>';
933     + } else {
934     + select(STDOUT);
935     + $| = 1;
936     +
937     + my $file;
938     + foreach $file (@restorefiles) {
939     + if ($file =~ /^(.*)$/) {
940     + $file = $1;
941     + } else {
942     + $error_message = "Unsecure data : $file\n";
943     + $error_message .= $c->bunmount($mntdir,$VFSType);
944     + die ($error_message);
945     + }
946     + print $c->l('bac_TESTED_BACKUP') .' '. $file;
947     + system ("/usr/bin/dar", "-Q", "--test", "$file", "--noconf");
948     + }
949     +
950     + $error_message = $c->bunmount($mntdir,$VFSType);
951     + die($error_message) if $error_message;
952     +
953     + exit(0);
954     + }
955     + #return;
956     +
957     + } else {
958     +
959     + # verify selected backup only
960     + # and display files saved in the backup
961     +
962     + my $backupkey = $verifyref;
963     + if ($backupkey =~ /^(.*)$/) {
964     + $backupkey = $1;
965     + } else {
966     + $error_message = "Unsecure data : $backupkey\n";
967     + $error_message .= $c->bunmount($mntdir,$VFSType);
968     + die ($error_message);
969     + }
970     +
971     + if (open(RD, "-|")) {
972     + $out .= '<b>'.$c->l('bac_FILES_IN_BACKUP').'</b><UL>';
973     + my $complete = 0;
974     + while (<RD>) {
975     + $complete++ if /etc\/samba\/smbpasswd$/;
976     + $out .= "<li>$_</li>";
977     + }
978     + $out .= '</UL>';
979     +
980     + my $status = close RD ?
981     + ($complete ?
982     + $c->l('bac_VERIFY_COMPLETE') :
983     + $c->l('bac_BACKUP_FILE_INCOMPLETE'))
984     + : ($c->l('bac_ERROR_READING_FILE').' : '.$backupkey);
985     + $out .= "<b> $status </b>";
986     + } else {
987     + select(STDOUT);
988     + $| = 1;
989     +
990     + system ("/usr/bin/dar", "-Q", "--list", "$backupkey", "--noconf") == 0
991     + or die ($c->l('bac_ERR_EXTRACT')." : ".$!);
992     +
993     + $error_message = $c->bunmount($mntdir,$VFSType);
994     + die($error_message) if $error_message;
995     + exit(0);
996     + }
997     + }
998     + return $out;
999     +}
1000     +
1001     +
1002     +sub workstnRestore {
1003     +
1004     + my ($c) = @_;
1005     +
1006     + my $out;
1007     + my $restoreref = $c->param('Backupset');
1008     + my $set = $restoreref;
1009     + $set =~ s/\/[^\/]*$//;
1010     + my %backupsetfiles = ();
1011     + my @restorefiles;
1012     +
1013     + my $backupsetlist = sub {
1014     + if ( $_ =~ /\.dar/ ) {
1015     + my $backupref = $File::Find::name;
1016     + $backupref =~ s/\.[0-9]+\.dar//;
1017     + $_ =~ s/\..*\.dar//;
1018     + $_ =~ s/.*-//;
1019     + $backupsetfiles{$_} = $backupref;
1020     + }
1021     + };
1022     +
1023     + my $lock_file = "/var/lock/subsys/e-smith-restore";
1024     + my $file_handle = &esmith::lockfile::LockFileOrReturn($lock_file);
1025     +
1026     + unless ($file_handle) {
1027     + return "$c->l('bac_RESTORE_CANNOT_PROCEED') <br> ($c->l('bac_ANOTHER_RESTORE_IN_PROGRESS')";
1028     + }
1029     +
1030     + my $backupwkrec = $cdb->get('backupwk');
1031     + my $id = $backupwkrec->prop('Id')
1032     + || $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1033     + my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb';
1034     + my $VFSType = $backupwkrec->prop('VFSType') || 'cifs';
1035     + my $smbhost = $backupwkrec->prop('SmbHost');
1036     + my $smbshare = $backupwkrec->prop('SmbShare');
1037     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1038     + my $err;
1039     + my $error_message;
1040     +
1041     + # Mounting backup shared folder
1042     + $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1043     + if ($error_message) {
1044     + return "$c->l('bac_RESTORE_CANNOT_PROCEED') $error_message : $id";
1045     + }
1046     + # Test if backup subdirectory for our server
1047     + my $mntbkdir = $mntdir . "/$id";
1048     + unless (-d $mntbkdir) {
1049     + $error_message = $c->l('bac_ERR_NO_HOST_DIR')."\n";
1050     + $error_message .= $c->bunmount($mntdir,$VFSType);
1051     + return "$c->l('bac_RESTORE_CANNOT_PROCEED') $error_message : $id";
1052     + }
1053     + # finding list of available backups
1054     + # and verifying all needed backup files are available
1055     +
1056     + find { wanted => \&$backupsetlist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$| }, $set ;
1057     +
1058     + my $key;
1059     + my $num = 0;
1060     + foreach $key (sort keys %backupsetfiles) {
1061     + push @restorefiles, $backupsetfiles{$key};
1062     + if ( $num == 0 ) {
1063     + unless ( $backupsetfiles{$key} =~ /\/full-/ ) {
1064     + return "$c->l('bac_RESTORE_CANNOT_PROCEED') $c->l('bac_ERR_NO_FULL_BACKUP')";
1065     + }
1066     + } else {
1067     + my $numf = sprintf("%03d", $num);
1068     + unless ( $backupsetfiles{$key} =~ /\/inc-$numf-/ ) {
1069     + return "$c->l('bac_RESTORE_CANNOT_PROCEED') $c->l('bac_ERR_NO_INC_BACKUP') . $numf";
1070     + }
1071     + }
1072     + $num++;
1073     + last if ( $backupsetfiles{$key} eq $restoreref );
1074     + }
1075     + # backup is online, restoring now
1076     +
1077     + my $rec = $rdb->get('restore');
1078     + $rec->set_prop('state','running');
1079     + $rec->set_prop('start', time);
1080     + $cdb->get('bootstrap-console')->set_prop('Run', 'yes');
1081     +
1082     + unless (system("/sbin/e-smith/signal-event", "pre-restore") == 0) {
1083     + return "$c->l('bac_OPERATION_STATUS_REPORT') $c->l('bac_ERR_PRE_RESTORE')";
1084     + }
1085     +
1086     + $| = 1;
1087     + if (open(RD, "-|")) {
1088     +
1089     + #-----------------------------------------------------
1090     + # restore system from uploaded workstation backup file
1091     + #-----------------------------------------------------
1092     + $out .= $c->l('bac_FILES_HAVE_BEEN_RESTORED')."\n";
1093     + $out .= '<UL>';
1094     + my $complete = 0;
1095     + while (<RD>) {
1096     + $complete++ if /etc\/samba\/smbpasswd$/;
1097     + $out .= "<li>$_</li>\n";
1098     + }
1099     + $out .= '</UL>';
1100     + my $message;
1101     +
1102     + if (!close RD) {
1103     + $message = $c->l('bac_RESTORE_FAILED_MSG');
1104     + } else {
1105     + #-----------------------------------------------------
1106     + # if restore completed, regenerate configuration files
1107     + #-----------------------------------------------------
1108     +
1109     + if ($complete) {
1110     + $out .= $c->l('bac_RESTORE_COMPLETE');
1111     + system("/usr/sbin/groupmod", "-g", "$www_gid", "www") == 0
1112     + or warn ($c->l('bac_ERR_RESTORING_GID')."\n");
1113     + system("/usr/sbin/usermod", "-g", "$www_gid", "www") == 0
1114     + or warn ($c->l('bac_ERR_RESTORING_INITIAL_GRP')."\n");
1115     + esmith::util::backgroundCommand(0,
1116     + "/sbin/e-smith/signal-event", "post-upgrade");
1117     + # system("/sbin/e-smith/signal-event", "post-upgrade") == 0
1118     + # or die ($c->l('bac_ERROR_UPDATING_CONFIGURATION')."\n");
1119     + } else {
1120     + $message = $c->l('bac_RESTORE_FAILED');
1121     + }
1122     + }
1123     + return $message if $message;
1124     +
1125     + $rec->set_prop('state', 'complete');
1126     + $rec->set_prop('finish', time);
1127     +
1128     + &esmith::lockfile::UnlockFile($file_handle);
1129     +
1130     + } else {
1131     +
1132     + select(STDOUT);
1133     + $| = 1;
1134     +
1135     + my $file;
1136     + foreach $file (@restorefiles) {
1137     + if ($file =~ /^(.*)$/) {
1138     + $file = $1;
1139     + } else {
1140     + $error_message = "Unsecure data : $file\n";
1141     + $error_message .= $c->bunmount($mntdir,$VFSType);
1142     + die ($error_message);
1143     + }
1144     + system ("/usr/bin/dar", "-Q", "-x", "$file", "-v", "-N", "-R", "/", "-wa");
1145     + }
1146     + $error_message = $c->bunmount($mntdir,$VFSType);
1147     + die($error_message) if $error_message;
1148     + exit(0);
1149     + }
1150     +
1151     + $rdb->reload;
1152     +
1153     + return '#OK#' . $out;
1154     +}
1155     +
1156     +
1157     +sub workstnSelRestore() {
1158     +
1159     + my $c = shift;
1160     +
1161     + my $rec = $cdb->get('backupwk');
1162     +
1163     + my %backupfiles = ();
1164     + my $mntdir = $rec->prop('Mount') || '/mnt/smb';
1165     + my $mntbkdir;
1166     + my $key;
1167     + my $id = $rec->prop('Id') ||
1168     + $cdb->get('SystemName')->value . '.' . $cdb->get('DomainName')->value;
1169     + my %blabels = ();
1170     + my @blabels;
1171     + my $backups = 0;
1172     + my $filterexp;
1173     + my $VFSType = $rec->prop('VFSType') || 'cifs';
1174     + my $smbhost = $rec->prop('SmbHost');
1175     + my $smbshare = $rec->prop('SmbShare');
1176     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1177     + my $err;
1178     + my $error_message;
1179     +
1180     + my $setbackuplist = sub {
1181     + if ( $_ =~ /\.dar/ )
1182     + {
1183     + my $dir = $File::Find::dir;
1184     + my $backupref;
1185     + $dir =~ s/$mntbkdir\///;
1186     + $_ =~ s/\..*\.dar//;
1187     + $backupref = $_;
1188     + $_ =~ s/.*-//;
1189     + @{$backupfiles{$_}}[0] = $dir;
1190     + @{$backupfiles{$_}}[1] = $backupref;
1191     + }
1192     + };
1193     +
1194     + # Mounting backup shared folder
1195     + $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1196     + if ($error_message) {
1197     + return ($error_message, $id);
1198     + }
1199     +
1200     + # Test if backup subdirectory for our server
1201     + $mntbkdir = $mntdir . "/$id";
1202     + unless (-d $mntbkdir) {
1203     + $error_message = $c->l('bac_ERR_NO_HOST_DIR')."\n";
1204     + $error_message .= $c->bunmount($mntdir,$VFSType);
1205     + return ($error_message, $id);
1206     + }
1207     +
1208     + my $catalog = "$mntbkdir/dar-catalog";
1209     + my $i = 0;
1210     + my $j = 0;
1211     + my @bknum;
1212     + my @setd;
1213     + my @bkname;
1214     +
1215     +
1216     + # update backups list from current catalog
1217     +
1218     + open(DAR_LIST, "/usr/bin/dar_manager -B $catalog -l |") ;
1219     +
1220     + $i = 0;
1221     + while (<DAR_LIST>)
1222     + {
1223     + next unless m/set/;
1224     + chomp;
1225     + ($bknum[$i], $setd[$i], $bkname[$i]) = split(' ', $_, 3);
1226     + $i++;
1227     + }
1228     + close (DAR_LIST);
1229     +
1230     + # set drop down list of backups
1231     + push @blabels, "0";
1232     + $blabels{"0"} = $c->l('ALL_BACKUPS');
1233     + $j = 0;
1234     + while ($j < $i)
1235     + {
1236     + push @blabels, $bknum[$j];
1237     + $blabels{$bknum[$j]} = $bkname[$j];
1238     + $j++
1239     + }
1240     +
1241     +}
1242     +
1243     +
1244     +sub updateWorkstnBackupConfig {
1245     +
1246     + my ($c) = @_;
1247     +
1248     + my $status = $c->param('Workstnbackup') || "";
1249     + my $inconly = $c->param('IncOnlyTimeout');
1250     + my $dof = $c->param('Dof');
1251     + my $ampm;
1252     + my $incOnlyTimeout;
1253     +
1254     + my $rec = $cdb->get('backupwk');
1255     + unless (defined $rec) {
1256     + $rec = $cdb->new_record('backupwk', {type=>'service'});
1257     + }
1258     + my $backupwkMount = $rec->prop('Mount') || '/mnt/smb';
1259     +
1260     + unless ( $status eq 'on') {
1261     + # set service to disabled
1262     + my $old = $cdb->get('UnsavedChanges')->value;
1263     +
1264     + $rec->set_prop('status', 'disabled');
1265     + $cdb->get('UnsavedChanges')->set_value($old);
1266     +
1267     + system("/sbin/e-smith/signal-event", "conf-backup") == 0
1268     + or die($c->l('bac_ERR_CONF_BACKUP')."\n");
1269     +
1270     + return '#OK#'.$c->l('bac_SUCCESSFULLY_DISABLED_WORKSTN');
1271     + }
1272     +
1273     + #--------------------------------------------------
1274     + # Untaint parameters and check for validity
1275     + #--------------------------------------------------
1276     +
1277     + my $VFSType = $c->param('VFSType');
1278     + if ( $VFSType eq 'nousb') {
1279     + return $c->l('bac_ERR_NO_USB_DISK')
1280     + }
1281     + if ( $VFSType eq 'nomnt') {
1282     + return $c->l('bac_ERR_NO_MOUNTED_DISK')
1283     + }
1284     +
1285     + my $backupwkStation = $c->param('BackupwkStation');
1286     + if ( $VFSType =~ m/usb|mnt/s) { $backupwkStation = 'localhost' }
1287     + if ($backupwkStation =~ /^\s*(\S+)\s*$/) {
1288     + $backupwkStation = $1;
1289     + } else {
1290     + $backupwkStation = "";
1291     + }
1292     + if ( $backupwkStation eq "" ) {
1293     + return $c->l('bac_ERR_INVALID_WORKSTN')
1294     + }
1295     +
1296     + my $backupwkFolder = $c->param('BackupwkFolder');
1297     + if ($backupwkFolder =~ /^(.*)$/) {
1298     + $backupwkFolder = $1;
1299     + } else {
1300     + $backupwkFolder = '';
1301     + }
1302     + if ( $VFSType eq 'usb' ) {
1303     + $backupwkFolder = 'media/' . $backupwkFolder;
1304     + }
1305     + if ( $VFSType eq 'mnt' ) {
1306     + $backupwkMount = $backupwkFolder;
1307     + if (checkMount ($backupwkMount)){$backupwkFolder = '';}
1308     + } else {
1309     + $backupwkFolder =~ s/^\///; # remove leading /
1310     + }
1311     + if ( $backupwkFolder eq '') {
1312     + return $c->l('bac_ERR_INVALID_FOLDER')
1313     + }
1314     +
1315     + my $backupwkLogin = $c->param('BackupwkLogin') || '';
1316     + if ($backupwkLogin =~ /^(.*)$/) {
1317     + $backupwkLogin = $1;
1318     + } else {
1319     + $backupwkLogin = "";
1320     + }
1321     + if ( ( $backupwkLogin eq "" ) && ( $VFSType eq 'cifs' ) ) {
1322     + return $c->l('bac_ERR_INVALID_LOGIN')
1323     + }
1324     +
1325     + my $backupwkPassword = $c->param('BackupwkPassword') || '';
1326     + if ($backupwkPassword =~ /^(.*)$/) {
1327     + $backupwkPassword = $1;
1328     + } else {
1329     + $backupwkPassword = "";
1330     + }
1331     + if ( ( $backupwkPassword eq "" ) && ( $VFSType eq 'cifs' ) ) {
1332     + return $c->l('bac_ERR_INVALID_PASSWORD')
1333     + }
1334     +
1335     + my $setsNumber = $c->param('SetsNumber');
1336     + unless ( $setsNumber > 0 ) {
1337     + return $c->l('bac_ERR_INVALID_SETS_NUMBERFOLDER')
1338     + }
1339     +
1340     + my $filesinset = $c->param('Filesinset');
1341     + unless ( $filesinset > 0 ) {
1342     + return $c->l('bac_ERR_INVALID_FILES_IN_SET_NUMBER')
1343     + }
1344     +
1345     + my $timeout = $c->param('BackupwkTimeout');
1346     + if (( $timeout eq '') || ( $timeout == 0 )) {$timeout = 24 }
1347     + if (( $timeout < 1 ) || ( $timeout > 24 )) {
1348     + return $c->l('bac_ERR_INVALID_TIMEOUT')
1349     + }
1350     +
1351     + if (defined $inconly && $inconly eq 'on') {
1352     + $incOnlyTimeout = 'yes';
1353     + } else {
1354     + $incOnlyTimeout = 'no';
1355     + }
1356     +
1357     + my $compression = $c->param('Compression');
1358     + if (( $compression < 0 ) || ( $compression > 9 )) {
1359     + return $c->l('bac_ERR_INVALID_COMPRESSION')
1360     + }
1361     +
1362     + $rec->set_prop('SmbHost', $backupwkStation);
1363     + $rec->set_prop('SmbShare', $backupwkFolder);
1364     + $rec->set_prop('Mount', $backupwkMount);
1365     + $rec->set_prop('Login', $backupwkLogin);
1366     + $rec->set_prop('Password', $backupwkPassword);
1367     + $rec->set_prop('SetsMax', $setsNumber);
1368     + $rec->set_prop('DaysInSet', $filesinset);
1369     + $rec->set_prop('Timeout', $timeout);
1370     + $rec->set_prop('IncOnlyTimeout', $incOnlyTimeout);
1371     + $rec->set_prop('Compression', $compression);
1372     + $rec->set_prop('FullDay', $dof);
1373     + $rec->set_prop('VFSType', $VFSType);
1374     +
1375     + my $module = $rec->prop('Program');
1376     +
1377     + # The default workstation backup program is dar.
1378     +
1379     + unless (defined $module) {
1380     + $module = 'dar';
1381     + } elsif ($module eq '') {
1382     + $module = 'dar';
1383     + }
1384     +
1385     + $rec->set_prop('Program', $module);
1386     +
1387     + my $backupwkHour = $c->param('BackupwkHour');
1388     + if ($backupwkHour =~ /^(.*)$/) {
1389     + $backupwkHour = $1;
1390     + } else {
1391     + $backupwkHour = '12';
1392     + }
1393     + if (($backupwkHour < 0) || ($backupwkHour > 12)) {
1394     + return $c->l('bac_ERR_INVALID_HOUR').$backupwkHour.
1395     + $c->l('bac_BETWEEN_0_AND_12')
1396     + }
1397     +
1398     + my $backupwkMin = $c->param('BackupwkMin');
1399     + if ($backupwkMin =~ /^(.*)$/) {
1400     + $backupwkMin = $1;
1401     + } else {
1402     + $backupwkMin = '0';
1403     + }
1404     + if (($backupwkMin < 0) || ($backupwkMin > 59)) {
1405     + return $c->l('bac_ERR_INVALID_MINUTE').$backupwkMin.
1406     + $c->l('bac_BETWEEN_0_AND_59');
1407     + }
1408     +
1409     + $backupwkMin = sprintf("%02d", $backupwkMin);
1410     +
1411     + $ampm = $c->param('BackupwkAMPM');
1412     + if ($ampm =~ /^(.*)$/) {
1413     + $ampm = $1;
1414     + } else {
1415     + $ampm = 'AM';
1416     + }
1417     +
1418     + # convert to 24 hour time
1419     + $backupwkHour = $backupwkHour % 12;
1420     + if ($ampm eq 'PM') {
1421     + $backupwkHour = $backupwkHour + 12;
1422     + }
1423     +
1424     + # variables passed validity checks, set configuration database values
1425     + my $old = $cdb->get('UnsavedChanges')->value;
1426     + $rec->set_prop('status', 'enabled');
1427     + $rec->set_prop('BackupTime', "$backupwkHour:$backupwkMin");
1428     + $cdb->get('UnsavedChanges')->set_value($old);
1429     +
1430     + system("/sbin/e-smith/signal-event", "conf-backup") == 0
1431     + or die($c->l('bac_ERR_CONF_BACKUP'),"\n");
1432     +
1433     + # we test if the remote host is reachable, else we simply display a warning
1434     + if ( $VFSType =~ m/cifs|nfs/s ) {
1435     + my $error_message = vmount($backupwkStation,$backupwkFolder,$backupwkMount,$VFSType);
1436     + if (! $error_message) {
1437     + $c->bunmount($backupwkMount,$VFSType);
1438     + } elsif ($error_message) {
1439     + return $c->l('bac_ERROR_WHEN_TESTING_REMOTE_SERVER'). "<br>$error_message";
1440     + }
1441     + }
1442     +
1443     + return '#OK#'.$c->l('bac_SUCCESSFULLY_ENABLED_WORKSTN'). '<br>'.
1444     + $c->l('bac_WITH_BACKUP_TIME')." $backupwkHour:$backupwkMin";
1445     +}
1446     +
1447     +
1448     +sub performWorkstnSelRestore {
1449     +
1450     + my ($c, $seldatebefore, $restorefiles) = @_;
1451     +
1452     + my $out;
1453     + my @restorelist;
1454     +
1455     + foreach ( @{$restorefiles} ) {
1456     + push @restorelist, "\"".$1."\"" if ($_ =~ /^(.*)$/);
1457     + }
1458     +
1459     + my $backupwkrec = $cdb->get('backupwk');
1460     + my $id = $backupwkrec->prop('Id') ||
1461     + $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1462     + my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb';
1463     + my $VFSType = $backupwkrec->prop('VFSType') || 'cifs';
1464     + my $smbhost = $backupwkrec->prop('SmbHost');
1465     + my $smbshare = $backupwkrec->prop('SmbShare');
1466     + my $err;
1467     + my $error_message;
1468     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1469     +
1470     + # Mounting backup shared folder
1471     + $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1472     + if ($error_message) {
1473     + $error_message .= " : $id";
1474     + return $error_message;
1475     + }
1476     +
1477     + # Test if backup subdirectory for our server
1478     + my $mntbkdir = $mntdir . "/$id";
1479     + unless (-d $mntbkdir) {
1480     + $error_message = $c->l('bac_ERR_NO_HOST_DIR')."\n";
1481     + $error_message .= $c->bunmount($mntdir,$VFSType);
1482     + $error_message .= " : $id";
1483     + return $error_message;
1484     + }
1485     +
1486     + # backup is online, restoring now
1487     + $| = 1;
1488     + my $restorerr;
1489     +
1490     + if (open(RD, "-|")) {
1491     + #-----------------------------------------------------
1492     + # restore system from uploaded workstation backup file
1493     + #-----------------------------------------------------
1494     + $out .= "<b>". $c->l('bac_FILES_HAVE_BEEN_RESTORED') ."</b> \n";
1495     + $out .= '<UL>';
1496     + while (<RD>) {
1497     + $out .= "<li>$_</li>\n";
1498     + }
1499     + $out .= '</UL>';
1500     + my $message;
1501     + if (!close RD) {
1502     + $message = $c->l('bac_RESTORE_FAILED_MSG');
1503     + } else {
1504     + if ($restorerr) {
1505     + $message = $c->l('bac_RESTORE_FAILED');
1506     + } else {
1507     + $message = $c->l('bac_RESTORE_COMPLETE');
1508     + }
1509     + }
1510     + $out .= "<b>$message </b>\n";
1511     + } else {
1512     + select(STDOUT);
1513     + $| = 1;
1514     + if ($seldatebefore) {
1515     + $restorerr = system("/usr/bin/dar_manager -B \"$mntbkdir/dar-catalog\" -Q -w $seldatebefore -e '-v -N -R / -w' -r @restorelist");
1516     + } else {
1517     + $restorerr = system("/usr/bin/dar_manager -B \"$mntbkdir/dar-catalog\" -Q -k -e '-v -N -R / -w' -r @restorelist");
1518     + }
1519     + $error_message = $c->bunmount($mntdir,$VFSType);
1520     + die($error_message) if $error_message;
1521     + exit(0);
1522     + }
1523     + return "#OK#" . $out;
1524     +}
1525     +
1526     +
1527     +sub performReboot {
1528     +
1529     + my ($c) = @_;
1530     +
1531     + #print "$c->l('bac_SERVER_REBOOT')";
1532     + #print "$c->l('bac_SERVER_WILL_REBOOT')";
1533     +
1534     + esmith::util::backgroundCommand( 2, "/sbin/e-smith/signal-event", "reboot" );
1535     + return "#OK#" . $c->l('bac_SERVER_WILL_REBOOT');
1536     +}
1537     +
1538     +
1539     +sub get_VFSType_options {
1540     +
1541     + my $c = shift;
1542     + return [[ $c->l('cifs') => 'cifs' ], [ $c->l('nfs') => 'nfs' ],
1543     + [ $c->l('local removable disk') => 'usb' ], [ $c->l('Mounted disk') => 'mnt' ]];
1544     +}
1545     +
1546     +
1547     +sub get_dow_list {
1548     +
1549     + my $c = shift;
1550     +
1551     + my @list = ();
1552     + my @dlabels = split(' ', $c->l('bac_DOW'));
1553     +
1554     + my $i = 0;
1555     + foreach (@dlabels) {
1556     + push @list, [ "$_" => "$i" ];
1557     + $i++;
1558     + }
1559     +
1560     +# put 'everyday' first
1561     + my $lastr = pop @list;
1562     + unshift @list, $lastr;
1563     +
1564     + return \@list;
1565     +}
1566     +
1567     +
1568     +sub get_BackupwkDest_options {
1569     +
1570     + my ($c, $VFSType) = @_;
1571     + my @usbdisks = ();
1572     +
1573     + if ( $VFSType eq 'usb' ) {
1574     + foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) {
1575     + $udi =~ m/^(\S+)/;
1576     +
1577     + my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted);
1578     +
1579     + if ($is_mounted eq "false\n") {
1580     + my $vollbl = qx(hal-get-property --udi $1 --key volume.label);
1581     + $vollbl =~ m/^(\S+)/;
1582     + if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';}
1583     + chomp $vollbl;
1584     + push @usbdisks, $vollbl;
1585     + }
1586     + }
1587     + # return undef unless ($usbdisks[0]);
1588     + }
1589     +
1590     + if ( $VFSType eq 'mnt' ) {
1591     + @usbdisks = findmnt ();
1592     + # return undef unless ($usbdisks[0]);
1593     + }
1594     + return \@usbdisks
1595     +}
1596     +
1597     +
1598     +sub get_function_options {
1599     +
1600     + my $c = shift;
1601     +
1602     + return [[ $c->l('bac_DESKTOP_BACKUP') => 'desktop_backup' ],
1603     + [ $c->l('bac_TAPE_CONFIGURE') => 'tape_configure' ],
1604     + [ $c->l('bac_TAPE_RESTORE') => 'tape_restore' ],
1605     + [ $c->l('bac_WORKSTN_CONFIGURE') => 'workstn_configure' ],
1606     + [ $c->l('bac_WORKSTN_VERIFY') => 'workstn_verify' ],
1607     + [ $c->l('bac_WORKSTN_RESTORE') => 'workstn_restore' ],
1608     + [ $c->l('bac_WORKSTN_SEL_RESTORE') => 'workstn_sel_restore']];
1609     +
1610     +}
1611     +
1612     +
1613     +sub get_shared_folder_to_verify () {
1614     +
1615     + my ($c) = @_;
1616     +
1617     + my $rec = $cdb->get('backupwk');
1618     + return undef unless $rec;
1619     +
1620     + my $id = $rec->prop('Id') || $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1621     + my $smbhost = $rec->prop('SmbHost');
1622     + my $smbshare = $rec->prop('SmbShare');
1623     +
1624     + return "$smbhost/$smbshare/$id";
1625     +}
1626     +
1627     +
1628     +sub get_Backupset_options () {
1629     +
1630     + my ($c) = @_;
1631     +
1632     + my $rec = $cdb->get('backupwk');
1633     + return undef unless $rec;
1634     +
1635     + my %backupfiles = ();
1636     + my $mntdir = $rec->prop('Mount') || '/mnt/smb';
1637     + my $id = $rec->prop('Id') || $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1638     + my $smbhost = $rec->prop('SmbHost');
1639     + my $smbshare = $rec->prop('SmbShare');
1640     + my $mntbkdir;
1641     + my $key;
1642     + my $VFSType = $rec->prop('VFSType') || 'cifs';
1643     + my $err;
1644     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1645     +
1646     + my $setbackuplist = sub {
1647     + if ( $_ =~ /\.dar/ ) {
1648     + my $dir = $File::Find::dir;
1649     + my $backupref;
1650     + $dir =~ s/$mntbkdir\///;
1651     + $_ =~ s/\..*\.dar//;
1652     + $backupref = $_;
1653     + $_ =~ s/.*-//;
1654     + @{$backupfiles{$_}}[0] = $dir;
1655     + @{$backupfiles{$_}}[1] = $backupref;
1656     + }
1657     + };
1658     +
1659     +
1660     + # Mounting backup shared folder
1661     + my $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1662     + return [] if $error_message;
1663     +
1664     + # Test if backup subdirectory for our server
1665     + $mntbkdir = $mntdir . "/$id";
1666     + unless (-d $mntbkdir) {
1667     + $error_message .= $c->bunmount($mntdir,$VFSType);
1668     + return [];
1669     + }
1670     +
1671     + # Finding existing backups
1672     + find { wanted => \&$setbackuplist, untaint => 1, untaint_pattern => qr|^([-+@\w\s./]+)$|}, $mntbkdir ;
1673     +
1674     + my %blabels = ();
1675     + my @list;
1676     +
1677     + foreach $key (sort keys %backupfiles) {
1678     + my $labkey = $mntbkdir . '/' . $backupfiles{$key}[0] . '/' . $backupfiles{$key}[1];
1679     + $blabels{$labkey} = $backupfiles{$key}[1] . " (" . $backupfiles{$key}[0] . ")";
1680     + push @list, [ "$blabels{$labkey}" => "$labkey" ];
1681     + }
1682     +
1683     + return \@list;
1684     +}
1685     +
1686     +
1687     +sub get_Restoreset_options () {
1688     +
1689     + my ($c) = @_;
1690     +
1691     + my $rec = $cdb->get('backupwk');
1692     + return [] unless $rec;
1693     +
1694     + my %backupfiles = ();
1695     + my $mntdir = $rec->prop('Mount') || '/mnt/smb';
1696     + my $id = $rec->prop('Id') || $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1697     + my $smbhost = $rec->prop('SmbHost');
1698     + my $smbshare = $rec->prop('SmbShare');
1699     + my $mntbkdir;
1700     + my $key;
1701     + my $VFSType = $rec->prop('VFSType') || 'cifs';
1702     + my $err;
1703     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1704     +
1705     + my $setbackuplist = sub {
1706     + if ( $_ =~ /\.dar/ ) {
1707     + my $dir = $File::Find::dir;
1708     + my $backupref;
1709     + $dir =~ s/$mntbkdir\///;
1710     + $_ =~ s/\..*\.dar//;
1711     + $backupref = $_;
1712     + $_ =~ s/.*-//;
1713     + @{$backupfiles{$_}}[0] = $dir;
1714     + @{$backupfiles{$_}}[1] = $backupref;
1715     + }
1716     + };
1717     +
1718     + # Mounting backup shared folder
1719     + my $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1720     + return [] if $error_message;
1721     +
1722     + # Test if backup subdirectory for our server
1723     + $mntbkdir = $mntdir . "/$id";
1724     + unless (-d $mntbkdir) {
1725     + $error_message .= $c->bunmount($mntdir,$VFSType);
1726     + return [];
1727     + }
1728     +
1729     + my $catalog = "$mntbkdir/dar-catalog";
1730     + my $i = 0; my $j = 0;
1731     + my @bknum; my @setd; my @bkname;
1732     +
1733     + # update backups list from current catalog
1734     + open(DAR_LIST, "/usr/bin/dar_manager -B $catalog -l |") ;
1735     + $i = 0;
1736     + while (<DAR_LIST>) {
1737     + next unless m/set/;
1738     + chomp;
1739     + ($bknum[$i], $setd[$i], $bkname[$i]) = split(' ', $_, 3);
1740     + $i++;
1741     + }
1742     + close (DAR_LIST);
1743     +
1744     + my @list;
1745     +
1746     + # set drop down list of backups
1747     + push @list, [ $c->l('bac_ALL_BACKUPS') => "0" ];
1748     + $j = 0;
1749     + while ($j < $i) {
1750     + push @list, [ $bkname[$j] => "$bknum[$j]" ];
1751     + $j++
1752     + }
1753     + return \@list;
1754     +}
1755     +
1756     +
1757     +sub get_Restorefiles_options {
1758     +
1759     + my ($c, $filterexp, $backupkey) = @_;
1760     +
1761     + my $rgfilter;
1762     + if ($filterexp =~ /^(.*)$/) {
1763     + $filterexp = $1;
1764     + $rgfilter = qr/$filterexp/;
1765     + } else {
1766     + $filterexp = "";
1767     + }
1768     + if ($backupkey =~ /^(.*)$/) {
1769     + $backupkey = $1;
1770     + } else {
1771     + die('Unsecure data : ' . $backupkey);
1772     + }
1773     + my $seldatebf;
1774     +
1775     + my $backupwkrec = $cdb->get('backupwk');
1776     + my $smbhost = $backupwkrec->prop('SmbHost');
1777     + my $smbshare = $backupwkrec->prop('SmbShare');
1778     + my $mntdir = $backupwkrec->prop('Mount') || '/mnt/smb';
1779     + my $key;
1780     + my $id = $backupwkrec->prop('Id') ||
1781     + $cdb->get('SystemName')->value . "." . $cdb->get('DomainName')->value;
1782     + my @flabels;
1783     + my %flabels = ();
1784     + my $VFSType = $backupwkrec->prop('VFSType') || 'cifs';
1785     + my $err;
1786     + my $error_message;
1787     + $mntdir = "/$smbshare" if ( $VFSType eq 'usb' );
1788     +
1789     + # Mounting backup shared folder
1790     + $error_message = $c->bmount($mntdir,$smbhost,$smbshare,$VFSType);
1791     + if ($error_message) {
1792     + warn "Backup - restore files: $error_message, $id \n";
1793     + return undef;
1794     + }
1795     +
1796     + # Test if backup subdirectory for our server
1797     + my $mntbkdir = $mntdir . "/$id";
1798     + unless (-d $mntbkdir) {
1799     + $error_message = $c->l('bac_ERR_NO_HOST_DIR')."\n";
1800     + $error_message .= $c->bunmount($mntdir,$VFSType);
1801     + warn "Backup - restore files: $error_message, $id \n";
1802     + return undef;
1803     + }
1804     +
1805     + # Read wanted file list from selected backup
1806     + if (open(RD, "-|")) {
1807     + my $regex = qr/\[.*\] */;
1808     + while (<RD>) {
1809     + chomp;
1810     + $_ =~ s/$regex//;
1811     + if ($filterexp) {next unless m/$rgfilter/};
1812     + push @flabels, $_;
1813     + }
1814     + my $status = close RD ?
1815     + $c->l('bac_READ_COMPLETE')
1816     + : ($c->l('bac_ERROR_READING_FILE').' : '.$backupkey);
1817     + } else {
1818     + select(STDOUT);
1819     + $| = 1;
1820     +
1821     + system("/usr/bin/dar_manager", "-B", "$mntbkdir/dar-catalog", "-u", "$backupkey") == 0
1822     + or die ($c->l('bac_ERR_EXTRACT')." : ".$!);
1823     +
1824     + $error_message = $c->bunmount($mntdir,$VFSType);
1825     + die($error_message) if $error_message;
1826     + exit(0);
1827     + }
1828     +
1829     + return \@flabels;
1830     +}
1831     +
1832     +
1833     sub CalculateSizes () {
1834    
1835     my $c = shift;
1836     @@ -680,64 +1879,49 @@
1837     open(DU, "-|")
1838     or exec '/usr/bin/du', '-s', @list;
1839    
1840     - while (<DU>)
1841     - {
1842     + while (<DU>) {
1843     my ($du) = split(/\s+/);
1844     $tarsize += $du;
1845     }
1846     close DU;
1847    
1848     $tarsize = showSize($tarsize);
1849     -
1850     #------------------------------------------------------------
1851     # figure out the size of the dump files
1852     #------------------------------------------------------------
1853     -
1854     my $dumpsize = 0;
1855    
1856     open(DF, "-|")
1857     - or exec '/bin/df', '-P', '-t', 'ext3', '-t', 'ext4';
1858     + or exec '/bin/df', '-P', '-t', 'ext4', '-t', 'xfs';
1859    
1860     - while (<DF>)
1861     - {
1862     + while (<DF>) {
1863     next unless (/^\//);
1864     -
1865     (undef, undef, my $s, undef) = split(/\s+/, $_);
1866     -
1867     $dumpsize += $s;
1868     }
1869     -
1870     # increase size by 10% to cope with dump overhead.
1871     -
1872     $dumpsize *= 1.1;
1873    
1874     close DF;
1875     -
1876     $dumpsize = showSize($dumpsize);
1877    
1878     #------------------------------------------------------------
1879     # how much free space is in /tmp
1880     #------------------------------------------------------------
1881     -
1882     my $tmpfree = 0;
1883     my $halffree = 0;
1884    
1885     open(DF, "-|")
1886     - or exec '/bin/df', '-P', '-t', 'ext3', '-t', 'ext4', '/tmp';
1887     + or exec '/bin/df', '-P', '-t', 'ext4', '-t', 'xfs', '/tmp';
1888    
1889     - while (<DF>)
1890     - {
1891     + while (<DF>) {
1892     next unless (/^\//);
1893     -
1894     (undef, undef, undef, my $s) = split(/\s+/, $_);
1895     -
1896     $tmpfree += $s;
1897     }
1898    
1899     close DF;
1900     -
1901     $halffree = $tmpfree / 2;
1902     -
1903     $tmpfree = showSize($tmpfree);
1904     $halffree = showSize($halffree);
1905    
1906     @@ -748,7 +1932,6 @@
1907     sub showSize {
1908    
1909     # convert size to Mb or Gb or Tb :) Remember, df reports in kb.
1910     -
1911     my $size = shift;
1912    
1913     my $Mb = 1024;
1914     @@ -772,186 +1955,172 @@
1915     }
1916    
1917    
1918     -sub tapeRestore {
1919     +sub desktopBackupRecordStatus {
1920    
1921     - my ($c, $lock_file, $file_handle) = @_;
1922     + my ($backup, $phase, $status) = @_;
1923     + my $now = time();
1924    
1925     - my $rec = $rdb->get('restore');
1926     - $rec->set_prop('state', 'running');
1927     - $rec->set_prop('start', time);
1928     + warn("Backup terminated: $phase failed - status: $status\n");
1929     + $backup->set_prop('EndEpochTime', "$now");
1930     + $backup->set_prop('Result', "$phase:$status");
1931     +}
1932    
1933     - my $sec = 10;
1934     - print "Refresh: $sec; URL=/smanager/backup\n";
1935     - print $c->l('bac_NOW_RESTORING_FROM_TAPE');
1936     - print $c->l('bac_MUST_REBOOT_AFTER_RESTORE');
1937     - print $c->l('bac_PAGE_REFRESH_IN', $sec);
1938    
1939     - my $child;
1940     +sub dmount {
1941    
1942     - if ($child = fork) {
1943     - # Parent
1944     - $SIG{'CHLD'} = 'IGNORE';
1945     - &esmith::lockfile::UnlockFile($file_handle);
1946     - return 'OK';
1947     + # mount dar unit according to dar-workstation configuration
1948     + # return nothing if mount successfull
1949     +
1950     + my ($host,$share,$mountdir,$login,$password,$VFSType) = @_;
1951     +
1952     + if ($VFSType eq 'cifs')
1953     + {
1954     + return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) );
1955     + }
1956     + elsif ($VFSType eq 'nfs') {
1957     + return ( qx(/bin/mount -t nfs -o nolock "$host:/$share" $mountdir 2>&1) );
1958     }
1959     - elsif (defined $child) {
1960     - # Child
1961     - # Re-establish the lock. Wait till it is relinquished by the parent.
1962     + elsif ($VFSType eq 'usb') {
1963     + my $device = "";
1964     + my $blkdev = "";
1965     + my $vollbl = "";
1966     + foreach my $udi (qx(hal-find-by-property --key volume.fsusage --string filesystem)) {
1967     + $udi =~ m/^(\S+)/;
1968     + my $is_mounted = qx(hal-get-property --udi $1 --key volume.is_mounted);
1969     +
1970     + if ($is_mounted eq "false\n") {
1971     + $blkdev = qx(hal-get-property --udi $1 --key block.device);
1972     + if ($blkdev =~ m/^(\S+)/) {$blkdev = $1;}
1973     + }
1974     + if ($is_mounted eq "false\n") {
1975     + $vollbl = qx(hal-get-property --udi $1 --key volume.label);
1976     + $vollbl =~ m/^(\S+)/;
1977     + if ($vollbl =~ /^\s/) {$vollbl = 'nolabel';}
1978     + }
1979     +
1980     + chomp $vollbl;
1981     + chomp $blkdev;
1982     + $vollbl = "media/$vollbl";
1983     + if ($vollbl eq $share) {
1984     + $device = $blkdev;
1985     + }
1986     + }
1987     + return ( qx(/bin/mount $device "/$share" 2>&1) );
1988     + } else {
1989     + return ("Error while mounting $host/$share : $VFSType not supported.\n");
1990     + }
1991     +}
1992    
1993     - $file_handle = &esmith::lockfile::LockFileOrWait($lock_file);
1994    
1995     - # Close STDOUT so that the web server connection is closed.
1996     - close STDOUT;
1997     +sub checkMount {
1998    
1999     - # Now reopen STDOUT for the child. Redirect it to STDERR.
2000     - open(STDOUT, ">&STDERR");
2001     + # check if $mountdir is mounted
2002     + my $mountdir = shift;
2003     + $|=1; # Auto-flush
2004    
2005     - unless(system("/sbin/e-smith/signal-event", "pre-restore") == 0)
2006     - {
2007     - $rec->set_prop('errmsg', $c->l('bac_ERR_PRE_RESTORE'));
2008     - $rec->delete_prop('state');
2009     - die ($c->l('bac_ERR_PRE_RESTORE'),"\n");
2010     - }
2011     + # copy STDOUT to another filehandle
2012     + open (my $STDOLD, '>&', STDOUT);
2013    
2014     - unless(system("/sbin/e-smith/signal-event", "restore-tape") == 0)
2015     - {
2016     - $rec->set_prop('errmsg', $c->l('bac_ERR_RESTORING_FROM_TAPE'));
2017     - $rec->delete_prop('state');
2018     - die ($c->l('bac_ERR_RESTORING_FROM_TAPE')."\n");
2019     - }
2020     + open(STDOUT, ">/dev/null");
2021     + if ( open(MOUNTDIR, "|-", "/bin/findmnt", $mountdir)){;}
2022    
2023     - #----------------------------------------
2024     - # regenerate configuration files
2025     - #----------------------------------------
2026     + # restore STDOUT
2027     + open (STDOUT, '>&', $STDOLD);
2028    
2029     - unless(system("/usr/sbin/groupmod", "-g", "$www_gid", "www") == 0)
2030     - {
2031     - $rec->set_prop('errmsg', $rec->prop('errmsg').'<br>'.
2032     - $c->l('bac_ERR_RESTORING_GID'));
2033     - warn ($c->l('bac_ERR_RESTORING_GID')."\n");
2034     - }
2035     - unless(system("/usr/sbin/usermod", "-g", "$www_gid", "www") == 0)
2036     - {
2037     - $rec->set_prop('errmsg', $rec->prop('errmsg').'<br>'.
2038     - $c->l('bac_ERR_RESTORING_INITIAL_GRP'));
2039     - warn ($c->l('bac_ERR_RESTORING_INITIAL_GRP')."\n");
2040     - }
2041     - unless(system("/sbin/e-smith/signal-event", "post-upgrade") == 0)
2042     - {
2043     - $rec->set_prop('errmsg', $rec->prop('errmsg').'<br>'.
2044     - $c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
2045     - $rec->delete_prop('state');
2046     - die ($c->l('bac_ERR_UPDATING_CONF_AFTER_TAPE_RESTORE'));
2047     - }
2048     + return (!close(MOUNTDIR));
2049     +}
2050    
2051     - my $finish = time;
2052     - $rec->set_prop('state', 'complete');
2053     - $rec->set_prop('finish', $finish);
2054    
2055     - my $start = $rec->prop('start');
2056     - $start = scalar localtime($start);
2057     - $finish = scalar localtime($finish);
2058     +sub bmount {
2059    
2060     - &esmith::lockfile::UnlockFile($file_handle);
2061     + my ($c, $mntdir, $host, $share, $VFSType) = @_;
2062     + # verify backup directory not already mounted
2063    
2064     - exit;
2065     + if (!checkMount ($mntdir)) {
2066     + return if ($VFSType eq 'mnt');
2067     + return ($c->l('bac_ERR_ALREADY_MOUNTED'));
2068     + } else {
2069     + if ($VFSType eq 'mnt') {
2070     + return ($c->l('bac_ERR_NOT_MOUNTED'));
2071     + }
2072     }
2073     - else
2074     - {
2075     - # Error
2076    
2077     - $rec->delete_prop('state');
2078     - $rec->set_prop('errmsg', $c->l('bac_COULD_NOT_FORK'));
2079     - die ($c->l("bac_COULD_NOT_FORK")." $!\n");
2080     + # create the directory mount point if it does not exist
2081     + my $err = createTree ($mntdir);
2082     + return ($c->l('bac_ERR_MOUNTING_SMBSHARE') . "<//$host/$share>\n" . $err) if $err;
2083     +
2084     + # mount the backup directory
2085     + $err = dmount($host,$share,$mntdir,'','',$VFSType);
2086     + return ($c->l('bac_ERR_MOUNTING_SMBSHARE') . "<//$host/$share>\n" . $err) if $err;
2087     +
2088     + # verify $mntdir is mounted
2089     + if (checkMount ($mntdir)) {
2090     + # The mount should have suceeded, but sometimes it needs more time,
2091     + # so sleep and then check again.
2092     + sleep 5;
2093     + if (checkMount ($mntdir)) {
2094     + return ($c->l('bac_ERR_NOT_MOUNTED'));
2095     + }
2096     }
2097     + return;
2098     }
2099    
2100    
2101     -sub get_VFSType_options {
2102     +sub bunmount {
2103    
2104     - my $c = shift;
2105     - return [[ $c->l('cifs') => 'cifs' ], [ $c->l('nfs') => 'nfs' ],
2106     - [ $c->l('local removable disk') => 'usb' ], [ $c->l('Mounted disk') => 'mnt' ]];
2107     -}
2108     + my ($c, $mount, $type) = @_;
2109     + return if ($type eq 'mnt'); # Don't unmount for type 'mnt'
2110    
2111     + if (!checkMount ($mount)) {
2112     + system('/bin/umount', '-f', $mount) == 0
2113     + or return ($c->l('bac_ERR_WHILE_UNMOUNTING'));
2114     + }
2115     + return;
2116     +}
2117    
2118     -sub getWorkstnBackupConfig {
2119    
2120     - my ($c) = @_;
2121     - my $out;
2122     +sub findmnt {
2123    
2124     - my $backupwk_status;
2125     - my $enabledIncOnlyTimeout = "";
2126     - my $backupwkLogin = 'backup';
2127     - my $backupwkPassword = 'backup';
2128     - my $backupwkStation = 'host';
2129     - my $backupwkFolder = 'share';
2130     - my $backupwkMount = '/mnt/smb';
2131     - my $setsNumber;
2132     - my $filesinset;
2133     - my $backupwkTime;
2134     - my $backupwkTimeout;
2135     - my $backupwkIncOnlyTimeout;
2136     - my $VFSType;
2137     - my $compression;
2138     - my $dof;
2139     - my @dlabels = split(' ', $c->l('bac_DOW'));
2140     + my @mntin = qx( findmnt -n -l -o TARGET );
2141     + my @mntout;
2142    
2143     - # Obtain backup informations from configuration
2144     - my $rec = $cdb->get('backupwk');
2145     - if ($rec) {
2146     - $backupwkTime = $rec->prop('BackupTime') || '2:00';
2147     - $backupwkLogin = $rec->prop('Login') || 'backup';
2148     - $backupwkPassword = $rec->prop('Password') || 'backup';
2149     - $backupwkStation = $rec->prop('SmbHost') || 'host';
2150     - $backupwkFolder = $rec->prop('SmbShare') || 'share';
2151     - $backupwkMount = $rec->prop('Mount') || '/mnt/smb';
2152     - $VFSType = $rec->prop('VFSType') || 'cifs';
2153     - $setsNumber = $rec->prop('SetsMax') || '1';
2154     - $filesinset = $rec->prop('DaysInSet') || '1';
2155     - $backupwkTimeout = $rec->prop('Timeout') || '12';
2156     - $backupwkIncOnlyTimeout = $rec->prop('IncOnlyTimeout') || 'yes';
2157     - $compression = $rec->prop('Compression') || '0';
2158     - $dof = (defined $rec->prop('FullDay')) ? $rec->prop('FullDay') : '7';
2159     - $backupwk_status = $rec->prop('status');
2160     + foreach my $mount (@mntin) {
2161     + next if ($mount =~ m/^\/proc|^\/dev|^\/sys|^\/boot/s);
2162     + chomp $mount;
2163     + next if ($mount eq '/');
2164     + push @mntout, $mount;
2165     }
2166     + return @mntout;
2167     +}
2168    
2169     - if ($rec) {
2170     - if ($VFSType eq 'usb') {
2171     - $out .= $c->l('bac_WORKSTN_BACKUP_USB').' '.$backupwkFolder.'<br/>';
2172     - }
2173     - elsif ($VFSType eq 'mnt') {
2174     - $out .= $c->l('bac_WORKSTN_BACKUP_MNT').' '.$backupwkMount.'<br/>';
2175     - } else {
2176     - $out .= $c->l('bac_WORKSTN_BACKUP_HOST').' '.$backupwkStation.' ';
2177     - $out .= $c->l('bac_WORKSTN_BACKUP_VFSTYPE').' '.$VFSType.'<br/>';
2178     - $out .= $c->l('bac_WORKSTN_BACKUP_SHARE').' '.$backupwkFolder.'<br/>';
2179     - }
2180     - if ($VFSType eq 'cifs') {
2181     - $out .= $c->l('bac_LOGIN').' '.$backupwkLogin.'<br/>';
2182     - $out .= $c->l('PASSWORD').' ********<br/>';
2183     - }
2184     - $out .= $c->l('bac_WORKSTN_BACKUP_SETSNUM').' '.$setsNumber.'<br/>';
2185     - $out .= $c->l('bac_WORKSTN_BACKUP_DAYSINSET').' '.$filesinset.'<br/>';
2186     - $out .= $c->l('bac_WORKSTN_BACKUP_COMPRESSION').' '.$compression.'<br/>';
2187     - $out .= $c->l('bac_WORKSTN_BACKUP_TOD').' '.$backupwkTime.'<br/>';
2188     - $out .= $c->l('bac_WORKSTN_BACKUP_TIMEOUT').' '.$backupwkTimeout.' '.$c->l('bac_HOURS');
2189     - if ( $backupwkIncOnlyTimeout eq 'yes' ) {
2190     - $out .= $c->l('bac_WORKSTN_BACKUP_INCONLY_TIMEOUT')
2191     - }
2192     - $out .= '<br/>';
2193    
2194     - if ( $dof eq '7' ) {
2195     - $out .= $c->l('bac_WORKSTN_FULL_BACKUP_EVERYDAY').'<br/>';
2196     - } else {
2197     - $out .= $c->l('bac_WORKSTN_FULL_BACKUP_DAY').' '.$dlabels[$dof].'<br/>';
2198     - }
2199     - } else {
2200     - $out = $c->l('bac_WORKSTN_BACKUP_NOT_CONFIGURED');
2201     +sub createTree {
2202     +
2203     + my $tree = shift;
2204     +
2205     + if (! -d "$tree") {
2206     + eval {make_path("$tree")};
2207     + return ("Error while creating $tree : $@. Maybe insufficient rights directory.\n") if $@;
2208     }
2209     + return;
2210     +}
2211    
2212     - return $out;
2213     +
2214     +sub vmount {
2215     +
2216     + #Used to test if the remote share is mountable when you save settings in database
2217     + # mount dar unit according to dar-workstation configuration in order to test the remote host
2218     + # return nothing if mount successfull
2219     +
2220     + my ($host,$share,$mountdir,$VFSType) = @_;
2221     +
2222     + if ($VFSType eq 'cifs') {
2223     + return ( qx(/bin/mount -t cifs "//$host/$share" $mountdir -o credentials=/etc/dar/CIFScredentials,nounix 2>&1) );
2224     + } elsif ($VFSType eq 'nfs') {
2225     + return ( qx(/bin/mount -t nfs -o nolock,timeo=30,retrans=1,retry=0 "$host:/$share" $mountdir 2>&1) );
2226     + }
2227     }
2228    
2229    
2230     1;
2231     +
2232     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Reboot.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Reboot.pm
2233     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/Controller/Reboot.pm 2020-11-19 11:53:26.000000000 +0400
2234     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/Controller/Reboot.pm 2021-01-27 00:42:44.000000000 +0400
2235     @@ -44,20 +44,24 @@
2236     my $debug = $c->param('debug');
2237    
2238     if ($function eq "reboot") {
2239     - $result = $c->l('rbo_REBOOT_SUCCEEDED') . $c->l('rbo_DESC_REBOOT');
2240     + $result = $c->l('rbo_REBOOT_SUCCEEDED') . '<br>' . $c->l('rbo_DESC_REBOOT');
2241     unless ($debug) {
2242     - system( "/sbin/e-smith/signal-event", "reboot" ) == 0
2243     - or die ("Error occurred while rebooting.\n");
2244     + esmith::util::backgroundCommand( 1, "/sbin/e-smith/signal-event", "reboot" );
2245     + # system( "/sbin/e-smith/signal-event", "reboot" ) == 0
2246     + # or die ("Error occurred while rebooting.\n");
2247     }
2248     } elsif ($function eq 'shutdown') {
2249     - $result = $c->l('rbo_SHUTDOWN_SUCCEEDED') . $c->l('rbo_DESC_SHUTDOWN');
2250     + $result = $c->l('rbo_SHUTDOWN_SUCCEEDED') . '<br>' . $c->l('rbo_DESC_SHUTDOWN');
2251     unless ($debug) {
2252     - system( "/sbin/e-smith/signal-event", "halt" ) == 0
2253     - or die ("Error occurred while halting.\n");
2254     + esmith::util::backgroundCommand( 1, "/sbin/e-smith/signal-event", "halt" );
2255     + # system( "/sbin/e-smith/signal-event", "halt" ) == 0
2256     + # or die ("Error occurred while halting.\n");
2257     }
2258     } elsif ($function eq 'reconfigure') {
2259     - $result = $c->l('rbo_RECONFIGURE_SUCCEEDED') . $c->l('rbo_DESC_RECONFIGURE');
2260     + $result = $c->l('rbo_RECONFIGURE_SUCCEEDED') . '<br>' . $c->l('rbo_DESC_RECONFIGURE');
2261     unless ($debug) {
2262     + # esmith::util::backgroundCommand( 1, "/sbin/e-smith/signal-event", "post-upgrade",
2263     + # "; ", "/sbin/e-smith/signal-event", "reboot" );
2264     system( "/sbin/e-smith/signal-event", "post-upgrade" ) == 0
2265     or die ("Error occurred while running post-upgrade.\n");
2266     system( "/sbin/e-smith/signal-event", "reboot" ) == 0
2267     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_bg.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_bg.lex
2268     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_bg.lex 2021-01-25 12:06:11.000000000 +0400
2269     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_bg.lex 2021-01-25 00:16:15.000000000 +0400
2270     @@ -83,7 +83,7 @@
2271     'bac_NO_UID_FOR_NAME' => 'Не може да се вземе uid на потребител с име:',
2272     'bac_PAGE_REFRESH_IN' => ' Тази страница ще се обнови за да покаже състоянието след {$sec} секунди, или щракнете <a href="/server-manager/cgi-bin/backup">тук</a>. ',
2273     'bac_Backup or restore' => 'Резервно копиране или възстановяване',
2274     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Сървърът съдържа твърде много данни за надеждно копиране на локалния компютър. </div> ',
2275     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Сървърът съдържа твърде много данни за надеждно копиране на локалния компютър.',
2276     'bac_WORKSTN_BACKUPS_DISABLED' => ' Резервните копия върху лента са <b>забранени</b> ',
2277     'bac_WORKSTN_BACKUPS_ENABLED' => ' Резервното копиране върху работна станция е <b>разрешено</b>. ',
2278     'bac_WKBACKUPS_RUN_AT' => 'Редовните резервни копия на лента ще се бъдат създавани в:',
2279     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_da.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_da.lex
2280     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_da.lex 2021-01-25 12:06:11.000000000 +0400
2281     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_da.lex 2021-01-25 00:13:43.000000000 +0400
2282     @@ -83,7 +83,7 @@
2283     'bac_NO_UID_FOR_NAME' => 'Kunne ikke finde brugerID for brugeren:',
2284     'bac_PAGE_REFRESH_IN' => ' Siden vil genopfiske statusvisningen om {$sec} sekunder, ellers klik <a href="/server-manager/cgi-bin/backup">her</a>. ',
2285     'bac_Backup or restore' => 'Sikkerhedskopi eller gendannelse',
2286     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Din server har for mange data til en pålidelig sikkerhedskopi til arbejdsstation. </div> ',
2287     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Din server har for mange data til en pålidelig sikkerhedskopi til arbejdsstation.',
2288     'bac_WORKSTN_BACKUPS_DISABLED' => ' Sikkerhedskopi til lokalnet er <b>deaktiveret</b> ',
2289     'bac_WORKSTN_BACKUPS_ENABLED' => ' Sikkerhedskopi til lokalnet er <b>aktiveret</b>. ',
2290     'bac_WKBACKUPS_RUN_AT' => 'Sikkerhedskopi til lokalnet vil foregå kl.:',
2291     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_de.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_de.lex
2292     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_de.lex 2021-01-25 12:06:11.000000000 +0400
2293     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_de.lex 2021-01-25 22:40:50.226000000 +0400
2294     @@ -83,7 +83,7 @@
2295     'bac_NO_UID_FOR_NAME' => 'Kann keine UID für den Benutzer mit dem folgenden Namen bekommen:',
2296     'bac_PAGE_REFRESH_IN' => ' Diese Seite wird in {$sec} Sekunden mit der Statusanzeige erneuert, oder drücken Sie <a href="/server-manager/cgi-bin/backup">hier</a>. ',
2297     'Backup or restore' => 'Sichern oder Wiederherstellen',
2298     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Auf Ihrem Server befinden sich zu viele Daten, um eine verläßliche Sicherung auf den lokalen Arbeitsplatz durchführen zu können. </div> ',
2299     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Auf Ihrem Server befinden sich zu viele Daten, um eine verläßliche Sicherung auf den lokalen Arbeitsplatz durchführen zu können.',
2300     'bac_WORKSTN_BACKUPS_DISABLED' => ' Workstation Backups sind <b>deaktiviert</b> ',
2301     'bac_WORKSTN_BACKUPS_ENABLED' => ' Workstation Backups sind im Moment <b>aktiviert</b>. ',
2302     'bac_WKBACKUPS_RUN_AT' => 'Das normale Workstation Backup wird laufen um:',
2303     @@ -98,7 +98,7 @@
2304     'bac_SUCCESSFULLY_ENABLED_WORKSTN' => 'Workstation Backups wurden erfolgreich aktiviert',
2305     'bac_SUCCESSFULLY_DISABLED_WORKSTN' => 'Workstation Backups erfolgreich deaktiviert',
2306     'bac_VERIFY_WORKSTN_BACKUP_FILE' => 'Workstation Backup überprüfen',
2307     -'bac_VERIFY_WORKSTN_BACKUP_DESC' => ' <p>Mit dieser Option werden Ihnen alle Dateinamen in einer erstellten Workstation Sicherung angezeigt. Sie können damit den Inhalt der Sicherung überprüfen. <b>Wählen Sie die Sicherung aus, die Sie prüfen möchten.</b></p> <p>Nur Dateien gekennzeichnet mit [Saved] sind in der Sicherung enthalten.</p> <br/>Sicherungsdateien aus folgendem Verzeichnis werden geprüft: ',
2308     +'bac_VERIFY_WORKSTN_BACKUP_DESC' => ' <p>Mit dieser Option werden Ihnen alle Dateinamen in einer erstellten Workstation Sicherung angezeigt. Sie können damit den Inhalt der Sicherung überprüfen. <b>Wählen Sie die Sicherung aus, die Sie prüfen möchten.</b></p> <p>Nur Dateien gekennzeichnet mit ~[Saved~] sind in der Sicherung enthalten.</p> <br/>Sicherungsdateien aus folgendem Verzeichnis werden geprüft: ',
2309     'bac_RESTORE_CONF_FROM_WORKSTN' => 'Server Einstellungen aus Workstation Backup wiederherstellen',
2310     'bac_RESTORE_CONF_FROM_WORKSTN_DESC' => ' <p>Dieser Prozess stellt die Konfigurations- und Benutzerdaten aus Ihrem Workstation Backup wieder her. <b>Die Wiederherstellung sollte auf einem neu installierten Server durchgeführt werden.</b></p> <p>Vergewissern Sie sich, dass das richtige Band eingelegt wurde, bevor Sie beginnen.</p> <p>Nach der Wiederherstellung muß der Server neu gestartet werden.</p>Wiederherstellung von: ',
2311     'bac_RESTORE_FROM_WORKSTN' => 'Wiederherstellung aus Workstation Backup',
2312     @@ -137,12 +137,12 @@
2313     'bac_BACKUP_CHOICE' => 'Dateien für Anzeige auswählen',
2314     'bac_SELECT_DATE_BEFORE' => 'Wiederherstellung der letzten Änderungen vor',
2315     'bac_FILTER_EXPRESSION' => 'Namen gefiltert nach',
2316     -'bac_READ_COMPLETE' => ' Sie können alle Verzeichnisse und Dateien, die Sie wiederherstellen möchten in der angezeigten Liste auswählen (benutzen Sie <i>Strg</i> oder <i>Shift</i> für Mehrfachselektionen).<br/> <b>Warnung:</b> Wenn Sie ein Verzeichnis selektieren, werden alle enthaltenen Dateien und Verzeichnisse wiederhergestellt.<p/> Standardmäßig wird die neueste Version der ausgewählten Dateien wiederhergestellt, falls Sie aber ein Datum im Format <i>[ [ [yyyy/]mm/]tt-]hh:mm[:ss]</i> angeben, wird der Prozess nur die neueste <b>vor dem gegebenen Datum</b> geänderte Version wiederherstellen. ',
2317     -'bac_ERR_INVALID_SELDATE' => 'Das Datumsformat ist ungültig, es muß wie folgt angegeben werden [ [ [yyyy/]mm/]dd-]hh:mm[:ss]. Das bedeutet: 2005/12/31-08:23:32 or 10-08:32 or 08:32',
2318     +'bac_READ_COMPLETE' => ' Sie können alle Verzeichnisse und Dateien, die Sie wiederherstellen möchten in der angezeigten Liste auswählen (benutzen Sie <i>Strg</i> oder <i>Shift</i> für Mehrfachselektionen).<br/> <b>Warnung:</b> Wenn Sie ein Verzeichnis selektieren, werden alle enthaltenen Dateien und Verzeichnisse wiederhergestellt.<p/> Standardmäßig wird die neueste Version der ausgewählten Dateien wiederhergestellt, falls Sie aber ein Datum im Format <i>~[ ~[ ~[yyyy/~]mm/~]tt-~]hh:mm~[:ss~]</i> angeben, wird der Prozess nur die neueste <b>vor dem gegebenen Datum</b> geänderte Version wiederherstellen. ',
2319     +'bac_ERR_INVALID_SELDATE' => 'Das Datumsformat ist ungültig, es muß wie folgt angegeben werden ~[ ~[ ~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]. Das bedeutet: 2005/12/31-08:23:32 or 10-08:32 or 08:32',
2320     'bac_SELECT_FILES_TO_RESTORE' => 'Dateien für Wiederherstellung auswählen',
2321     'bac_ERR_WHILE_UNMOUNTING' => 'Fehler bei der Trennung entfernter Freigaben',
2322     'bac_ERR_DAR_CATALOG' => 'Fehler bei der Nutzung des Dar-Kataloges',
2323     -'bac_COMPRESSION_LEVEL' => 'Komprimierungsgrad [0-9] für das Backup',
2324     +'bac_COMPRESSION_LEVEL' => 'Komprimierungsgrad ~[0-9~] für das Backup',
2325     'bac_FULL_ONLY_ON' => 'Gesamtsicherung erlaubt auf',
2326     'bac_ERR_INVALID_COMPRESSION' => 'Der Komprimierungsgrad muss zwischen 0 (keine) und 9 (maximale Komprimierung) eingestellt sein',
2327     'bac_DOW' => 'Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag Täglich',
2328     @@ -177,8 +177,12 @@
2329     'bac_TESTED_BACKUP' => 'Überprüfe die Integrität der Sicherung',
2330     'bac_RESTORE_VERIFY_FAILED' => 'Prüfung der Integrität ist fehlgeschlagen',
2331     'bac_CHECK_INTEGRITY_WARNING' => 'Warnung: Bei großen Sicherungen kann die Überprüfung der Integrität eine langwierige Sache werden und sollte bei täglichem Workstation Backup deaktiviert sein.',
2332     -'bac_cifs' => 'CIFS',
2333     -'bac_nfs' => 'NFS',
2334     -'bac_local removable disk' => 'Lokaler Wechseldatenträger',
2335     -'bac_Mounted disk' => 'Eingebunder Datenträger',
2336     + 'bac_cifs' =>
2337     + 'CIFS',
2338     + 'bac_nfs' =>
2339     + 'NFS',
2340     + 'bac_local removable disk' =>
2341     + 'Lokaler Wechseldatenträger',
2342     + 'bac_Mounted disk' =>
2343     + 'Eingebunder Datenträger',
2344     'bac_ERROR_WHEN_TESTING_REMOTE_SERVER' => 'Die Parameter wurden gespeichert, aber der entfernte Host ist nicht erreichbar, bitte überprüfen Sie die Einstellungen.',
2345     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_en.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_en.lex
2346     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_en.lex 2021-01-25 12:06:11.000000000 +0400
2347     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_en.lex 2021-01-25 22:41:36.778000000 +0400
2348     @@ -230,14 +230,14 @@
2349     (use ctrl or shift for multiple selection). <br/> <b>Warning :</b> If you select a directory,
2350     all contained files and directories will be restored.<p/>
2351     By default the most recent version of selected files is restored, but if you specify a date
2352     -in the format <i>[ [ [yyyy/]mm/]dd-]hh:mm[:ss]</i> the process
2353     +in the format <i>~[~[~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]</i> the process
2354     will restore only the most recent version modified <b>before the given date</b>.',
2355     -'bac_ERR_INVALID_SELDATE' => 'Date format is invalid, must be [ [ [yyyy/]mm/]dd-]hh:mm[:ss]. ie: 2005/12/31-08:23:32 or
2356     +'bac_ERR_INVALID_SELDATE' => 'Date format is invalid, must be ~[~[~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]. ie: 2005/12/31-08:23:32 or
2357     10-08:32 or 08:32',
2358     'bac_SELECT_FILES_TO_RESTORE' => 'Select files to restore',
2359     'bac_ERR_WHILE_UNMOUNTING' => 'Error occurs when unmounting distant share',
2360     'bac_ERR_DAR_CATALOG' => 'Error when using Dar catalog',
2361     -'bac_COMPRESSION_LEVEL' => 'Backup compression level (0-9)',
2362     +'bac_COMPRESSION_LEVEL' => 'Backup compression level ~[0-9~]',
2363     'bac_FULL_ONLY_ON' => 'Full backup is allowed on',
2364     'bac_ERR_INVALID_COMPRESSION' => 'Compression level must be set between 0 (no compression) and 9 (maximum compression)',
2365     'bac_DOW' => 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Everyday',
2366     @@ -279,3 +279,4 @@
2367     'bac_local removable disk' => 'Local removable disk',
2368     'bac_Mounted disk' => 'Mounted disk',
2369     'bac_ERROR_WHEN_TESTING_REMOTE_SERVER' => 'The parameters have been saved, however the remote host is not reachable, please check your settings.',
2370     +'bac_ERR_EXTRACT' => 'Error when extracting with Dar',
2371     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_es.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_es.lex
2372     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_es.lex 2021-01-25 12:06:11.000000000 +0400
2373     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_es.lex 2021-01-25 22:45:08.371000000 +0400
2374     @@ -83,7 +83,7 @@
2375     'bac_NO_UID_FOR_NAME' => 'No se pudo obtener el uid para el usuario llamado:',
2376     'bac_PAGE_REFRESH_IN' => ' Esta página se actualizará a la pantalla de estado en {$sec} segundos o haga clic <a href="/server-manager/cgi-bin/backup">aquí</a>. ',
2377     'Backup or restore' => 'Respaldar o restaurar',
2378     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Su servidor tiene demasiados datos para realizar un respaldo confiable al escritorio. </div> ',
2379     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Su servidor tiene demasiados datos para realizar un respaldo confiable al escritorio.',
2380     'bac_WORKSTN_BACKUPS_DISABLED' => ' Los respaldos en ordenador remoto están <b>deshabilitados</b> ',
2381     'bac_WORKSTN_BACKUPS_ENABLED' => ' Los respaldos en ordenador remoto están <b>habilitados</b>. ',
2382     'bac_WKBACKUPS_RUN_AT' => 'Los respaldos regulares en ordenador remoto se ejecutarán a las:',
2383     @@ -138,11 +138,11 @@
2384     'bac_SELECT_DATE_BEFORE' => 'Restaurar el más reciente antes de',
2385     'bac_FILTER_EXPRESSION' => 'Nombres filtrados por',
2386     'bac_READ_COMPLETE' => ' Puede elegir todos los directorios y archivos que desee restaurar en la lista mostrada (use ctrl o shift para selecciones múltiples). <br/><b>Advertencia :</b> Si selecciona un directorio, todos los archivos y directorios contenidos serán restaurados.<p/> Por defecto será restaurada la versión más reciente de los archivos seleccionados, pero si usted especifica una fecha en el formato <i>[ [ [yyyy/]mm/]dd-]hh:mm[:ss]</i> el proceso restaurará solamente la versión más recientemente modificada <b>anterior a la fecha suministrada</b>. ',
2387     -'bac_ERR_INVALID_SELDATE' => 'El formato de fecha es inválido, debe ser [ [ [yyyy/]mm/]dd-]hh:mm[:ss]. ej: 2005/12/31-08:23:32 o 10-08:32 o 08:32',
2388     +'bac_ERR_INVALID_SELDATE' => 'El formato de fecha es inválido, debe ser ~[ ~[ ~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]. ej: 2005/12/31-08:23:32 o 10-08:32 o 08:32',
2389     'bac_SELECT_FILES_TO_RESTORE' => 'Seleccionar archivos para restaurar',
2390     'bac_ERR_WHILE_UNMOUNTING' => 'Ha ocurrido un error cuando se desmontaba el recurso compartido distante',
2391     'bac_ERR_DAR_CATALOG' => 'Ocurrió un error cuando se estaba utilizando el catálogo Dar',
2392     -'bac_COMPRESSION_LEVEL' => 'Nivel de compresión del respaldo [0-9]',
2393     +'bac_COMPRESSION_LEVEL' => 'Nivel de compresión del respaldo ~[0-9~]',
2394     'bac_FULL_ONLY_ON' => 'Respaldos completos son permitidos en',
2395     'bac_ERR_INVALID_COMPRESSION' => 'El nivel de compresión debe fijarse entre 0 (sin compresión) y 9 (compresión máxima)',
2396     'bac_DOW' => 'Domingo Lunes Martes Miércoles Jueves Viernes Sábado Diario',
2397     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_fr.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_fr.lex
2398     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_fr.lex 2021-01-25 12:06:11.000000000 +0400
2399     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_fr.lex 2021-01-25 19:17:16.000000000 +0400
2400     @@ -1,6 +1,6 @@
2401     'bac_BACKUP_TITLE' => 'Sauvegarde et restauration des données du serveur',
2402     -'bac_BACKUP_DESC' => ' <p>Vous disposez de deux méthodes pour sauvegarder et restaurer votre serveur : à distance sur un ordinateur du réseau local ou sur un lecteur/enregistreur de bande magnétique.</p><p>La première méthode crée une archive des fichiers de configuration du serveur et des données des utilisateurs et la télécharge sur un ordinateur de votre réseau local à l\'aide d\'un navigateur Internet. Actuellement, vos fichiers de configuration et de données totalisent environ <b>$tarsize</b>. La taille du fichier de sauvegarde sera quelque peu inférieure à cela, en fonction du degré de compressibilité des données. L\'option \"Vérifier le fichier de sauvegarde de l\'ordinateur\" peut être utilisée pour vérifier l\'intégrité d\'un fichier de sauvegarde stocké sur l\'ordinateur local.</p> <p>La méthode de sauvegarde sur bande utilise le programme <i>$module</i> pour sauvegarder quotidiennement tout votre disque dur. Ceci nécessite que le lecteur/enregistreur de bande magnétique soit pris en charge et que la bande ne soit pas protégée contre l\'écriture. La sauvegarde est exécutée automatiquement chaque jour à l\'heure sélectionnée, (avec un rappel envoyé à l\'administrateur dans la journée par courriel.<br>Actuellement, votre disque dur contient <b>$dumpsize</b> de données.</p><p>Les deux méthodes de restauration vous permettent de restaurer vos fichiers de configuration et les données des utilisateurs.<br><b>Idéalement, la restauration ne devrait se faire que sur un serveur nouvellement installé</b>.</p>',
2403     -'bac_BACKUP_DESC_DAR' => ' <P>Vous disposez de trois méthodes de sauvegarde et de restauration de votre serveur : sur votre ordinateur local, un lecteur/enregistreur de bandes ou un ordinateur distant sur votre réseau local.</P> <P>La première méthode crée une copie de la configuration du serveur et des données utilisateur puis les transfère sur votre ordinateur local, via votre navigateur Internet. Actuellement, la taille totale de ces données représente approximativement <b>$tarsize</b>. La taille du fichier de sauvegarde sera légèrement inférieure à ceci, en fonction de la compressibilité de ces données. Ce fichier peut être utilisé pour restaurer votre serveur depuis la console si vous le copiez sur un média de stockage tel qu\'un disque amovible.</P><P>La méthode de sauvegarde sur bande exploite le programme <i>$module</i> pour sauvegarder quotidiennement l\'intégralité du disque dur du serveur. Ceci nécessite l\'emploi d\'un lecteur/enregistreur de bandes reconnu et d\'une bande non protégée en écriture. La sauvegarde est effectuée automatiquement à l\'heure sélectionnée (un courriel de rappel est aussi envoyé automatiquement à l\'administrateur). Actuellement, la taille totale utilisée sur le disque dur de votre serveur représente approximativement <b>$dumpsize</b>.</P> <p>La méthode de sauvegarde sur un ordinateur distant exploite le programme <i>dar</i> pour sauvegarder la configuration de votre serveur et les données utilisateur vers un ordinateur sur votre réseau local (ou un disque USB connecté au serveur). Ceci nécessite que vous disposiez d\'un partage accessible en écriture (smbfs, cifs, ou nfs) sur l\'ordinateur distant ou d\'un disque USB sur le serveur. Vous pouvez définir le nombre de jeux de sauvegardes devant être conservés sur le partage, ainsi que la possibilité de créer des jeux de sauvegardes incrémentales sur plusieurs jours. La sauvegarde est effectuée automatiquement à l\'heure sélectionnée. Actuellement, les fichiers de configuration et de données représentent approximativement <b>$tarsize</b> non compressés. Le partage de sauvegarde doit offrir deux fois la taille d\'une sauvegarde non compressée.</p> <p>Toutes les méthodes de restauration vous permettent de restaurer la configuration du serveur et des données utilisateur. La sauvegarde sur un ordinateur distant permet de restaurer chaque fichier individuellement. <b>Idéalement, une restauration complète devrait être effectuée sur un serveur nouvellement installé</b>.</p> ',
2404     +'bac_BACKUP_DESC' => ' <p>Vous disposez de deux méthodes pour sauvegarder et restaurer votre serveur : à distance sur un ordinateur du réseau local ou sur un lecteur/enregistreur de bande magnétique.</p><p>La première méthode crée une archive des fichiers de configuration du serveur et des données des utilisateurs et la télécharge sur un ordinateur de votre réseau local à l\'aide d\'un navigateur Internet. Actuellement, vos fichiers de configuration et de données totalisent environ <b>[_2]</b>. La taille du fichier de sauvegarde sera quelque peu inférieure à cela, en fonction du degré de compressibilité des données. L\'option \"Vérifier le fichier de sauvegarde de l\'ordinateur\" peut être utilisée pour vérifier l\'intégrité d\'un fichier de sauvegarde stocké sur l\'ordinateur local.</p> <p>La méthode de sauvegarde sur bande utilise le programme <i>[_1]</i> pour sauvegarder quotidiennement tout votre disque dur. Ceci nécessite que le lecteur/enregistreur de bande magnétique soit pris en charge et que la bande ne soit pas protégée contre l\'écriture. La sauvegarde est exécutée automatiquement chaque jour à l\'heure sélectionnée, (avec un rappel envoyé à l\'administrateur dans la journée par courriel.<br>Actuellement, votre disque dur contient <b>[_2]</b> de données.</p><p>Les deux méthodes de restauration vous permettent de restaurer vos fichiers de configuration et les données des utilisateurs.<br><b>Idéalement, la restauration ne devrait se faire que sur un serveur nouvellement installé</b>.</p>',
2405     +'bac_BACKUP_DESC_DAR' => ' <P>Vous disposez de trois méthodes de sauvegarde et de restauration de votre serveur : sur votre ordinateur local, un lecteur/enregistreur de bandes ou un ordinateur distant sur votre réseau local.</P> <P>La première méthode crée une copie de la configuration du serveur et des données utilisateur puis les transfère sur votre ordinateur local, via votre navigateur Internet. Actuellement, la taille totale de ces données représente approximativement <b>[_2]</b>. La taille du fichier de sauvegarde sera légèrement inférieure à ceci, en fonction de la compressibilité de ces données. Ce fichier peut être utilisé pour restaurer votre serveur depuis la console si vous le copiez sur un média de stockage tel qu\'un disque amovible.</P><P>La méthode de sauvegarde sur bande exploite le programme <i>[_1]</i> pour sauvegarder quotidiennement l\'intégralité du disque dur du serveur. Ceci nécessite l\'emploi d\'un lecteur/enregistreur de bandes reconnu et d\'une bande non protégée en écriture. La sauvegarde est effectuée automatiquement à l\'heure sélectionnée (un courriel de rappel est aussi envoyé automatiquement à l\'administrateur). Actuellement, la taille totale utilisée sur le disque dur de votre serveur représente approximativement <b>[_3]</b>.</P> <p>La méthode de sauvegarde sur un ordinateur distant exploite le programme <i>dar</i> pour sauvegarder la configuration de votre serveur et les données utilisateur vers un ordinateur sur votre réseau local (ou un disque USB connecté au serveur). Ceci nécessite que vous disposiez d\'un partage accessible en écriture (smbfs, cifs, ou nfs) sur l\'ordinateur distant ou d\'un disque USB sur le serveur. Vous pouvez définir le nombre de jeux de sauvegardes devant être conservés sur le partage, ainsi que la possibilité de créer des jeux de sauvegardes incrémentales sur plusieurs jours. La sauvegarde est effectuée automatiquement à l\'heure sélectionnée. Actuellement, les fichiers de configuration et de données représentent approximativement <b>[_3]</b> non compressés. Le partage de sauvegarde doit offrir deux fois la taille d\'une sauvegarde non compressée.</p> <p>Toutes les méthodes de restauration vous permettent de restaurer la configuration du serveur et des données utilisateur. La sauvegarde sur un ordinateur distant permet de restaurer chaque fichier individuellement. <b>Idéalement, une restauration complète devrait être effectuée sur un serveur nouvellement installé</b>.</p> ',
2406     'bac_BACKUP_CONFIG_STATUS' => 'Configuration et état de la sauvegarde',
2407     'bac_TAPE_BACKUPS_ENABLED' => ' Les sauvegardes sur bande sont actuellement <b>activées</b>. ',
2408     'bac_BACKUPS_RUN_AT' => 'Les sauvegardes régulières sur bande seront exécutées à:',
2409     @@ -26,7 +26,7 @@
2410     'bac_ERR_POST_BACKUP' => 'Une erreur est survenue lors des opérations succédant à la sauvegarde.',
2411     'bac_RESTORE_SERVER_CONFIG' => 'Restaurer la configuration du serveur',
2412     'bac_DESKTOP_RESTORE_DESC' => ' Cette action va vous permettre de télécharger un fichier de sauvegarde depuis votre ordinateur local vers votre serveur. Ceci permettra de restaurer la configuration du serveur et les données des utilisateurs. <B>Cette restauration ne devrait être effectuée que sur un serveur nouvellement installé</B>. ',
2413     -'bac_FREE_SPACE' => ' L\'espace libre disponible sur votre serveur est d\'environ <b>$tmpfree</b>. Vérifiez que la taille du fichier de sauvegarde sur votre ordinateur local est inférieure à <b>$halffree</b> avant de commencer la restauration. ',
2414     +'bac_FREE_SPACE' => ' L\'espace libre disponible sur votre serveur est d\'environ <b>[_1]</b>. Vérifiez que la taille du fichier de sauvegarde sur votre ordinateur local est inférieure à <b>[_2]</b> avant de commencer la restauration. ',
2415     'bac_MUST_REBOOT_AFTER_RESTORE' => 'À la fin de la restauration, vous devrez redémarrer le serveur.',
2416     'bac_FILE_TO_RESTORE' => 'Sélectionnez le fichier de sauvegarde à restaurer',
2417     'bac_VERIFY_BACKUP_DESC' => ' <p>Cette option va afficher le nom de tous les fichiers contenus dans un fichier de sauvegarde déjà stocké sur l\'ordinateur local. Vous pouvez utiliser cette option pour vérifier le contenu du fichier de sauvegarde.</p> ',
2418     @@ -81,9 +81,9 @@
2419     'bac_SERVER_REBOOT' => 'Redémarrage du serveur',
2420     'bac_SERVER_WILL_REBOOT' => 'Votre serveur va maintenant redémarrer.',
2421     'bac_NO_UID_FOR_NAME' => 'Impossible d\'obtenir l\'UID de l\'utilisateur :',
2422     -'bac_PAGE_REFRESH_IN' => ' Cette page s\'actualisera dans {$sec} secondes pour afficher l\'état de l\'opération en cours. Vous pouvez également actualiser la page en cliquant <a href="/server-manager/cgi-bin/backup">ici</a>. ',
2423     +'bac_PAGE_REFRESH_IN' => ' Cette page s\'actualisera dans [_1] secondes pour afficher l\'état de l\'opération en cours. Vous pouvez également actualiser la page en cliquant <a href="/smanager/backup">ici</a>. ',
2424     'Backup or restore' => 'Sauvegarde et restauration',
2425     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Le volume de données stockées sur votre serveur est trop important pour assurer la fiabilité de la sauvegarde sur l\'ordinateur local. </div> ',
2426     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Le volume de données stockées sur votre serveur est trop important pour assurer la fiabilité de la sauvegarde sur l\'ordinateur local.',
2427     'bac_WORKSTN_BACKUPS_DISABLED' => ' Les sauvegardes sur un ordinateur distant sont actuellement <b>désactivées</b>. ',
2428     'bac_WORKSTN_BACKUPS_ENABLED' => ' Les sauvegardes sur un ordinateur distant sont actuellement <b>activées</b>. ',
2429     'bac_WKBACKUPS_RUN_AT' => 'Les sauvegardes quotidiennes sur un ordinateur distant seront exécutées à',
2430     @@ -98,7 +98,7 @@
2431     'bac_SUCCESSFULLY_ENABLED_WORKSTN' => 'Activation réussie des sauvegardes sur un ordinateur distant',
2432     'bac_SUCCESSFULLY_DISABLED_WORKSTN' => 'Désactivation réussie des sauvegardes sur un ordinateur distant',
2433     'bac_VERIFY_WORKSTN_BACKUP_FILE' => 'Vérifier les sauvegardes sur un ordinateur distant',
2434     -'bac_VERIFY_WORKSTN_BACKUP_DESC' => ' <p>Cette option va afficher le nom de tous les fichiers inclus dans une précédente sauvegarde quotidienne sur un ordinateur distant. Vous pouvez utiliser cette option pour vérifier le contenu de la sauvegarde.<b>Vous allez choisir la sauvegarde à vérifier.</b></p> <p>Seuls les fichiers portant la mention [Saved] sont effectivement inclus dans la sauvegarde sélectionnée.</p> Les fichiers de sauvegarde sont vérifiés à partir du dossier partagé : ',
2435     +'bac_VERIFY_WORKSTN_BACKUP_DESC' => ' <p>Cette option va afficher le nom de tous les fichiers inclus dans une précédente sauvegarde quotidienne sur un ordinateur distant. Vous pouvez utiliser cette option pour vérifier le contenu de la sauvegarde.<b>Vous allez choisir la sauvegarde à vérifier.</b></p> <p>Seuls les fichiers portant la mention ~[Saved~] sont effectivement inclus dans la sauvegarde sélectionnée.</p> Les fichiers de sauvegarde sont vérifiés à partir du dossier partagé : ',
2436     'bac_RESTORE_CONF_FROM_WORKSTN' => 'Restaurer la configuration du serveur à partir d\'une sauvegarde sur un ordinateur distant',
2437     'bac_RESTORE_CONF_FROM_WORKSTN_DESC' => ' <p>Cette action restaurera les fichiers de configuration du serveur et les données des utilisateurs à partir d\'une sauvegarde sur un ordinateur distant.<br> <b>Cette restauration ne devrait être effectuée que sur un serveur nouvellement installé</b>.</p> <p>Assurez-vous de sélectionner le bon fichier de sauvegarde avant de poursuivre.</p> <p>Après la fin de la restauration, vous devrez redémarrer le serveur.</p> La restauration va être effectuée à partir de : ',
2438     'bac_RESTORE_FROM_WORKSTN' => 'Restaurer à partir d\'un ordinateur distant',
2439     @@ -137,12 +137,12 @@
2440     'bac_BACKUP_CHOICE' => 'Sélectionner les fichiers à afficher',
2441     'bac_SELECT_DATE_BEFORE' => 'Restaurer les plus récents avant cette date',
2442     'bac_FILTER_EXPRESSION' => 'Filtrage des noms par',
2443     -'bac_READ_COMPLETE' => ' Vous pouvez choisir tous les dossiers et les fichiers que vous voulez restaurer dans la liste affichée (utiliser ctrl ou shift pour des sélections multiples). <br/> <b>Attention :</b> Si vous sélectionnez un répertoire, tous ses fichiers et sous-dossiers vont être restaurés.<p/> Par défaut, la version la plus récente des fichiers sélectionnés est restaurée mais si vous indiquez une date avec le format <i>[ [ [aaaa/]mm/]jj-]hh:mm[:ss]</i> le processus va uniquement restaurer la plus récente des versions ayant été modifiée <b>avant cette date</b>. ',
2444     -'bac_ERR_INVALID_SELDATE' => 'Le format de la date est invalide. Il doit être du style [ [ [aaaa/]mm/]jj-]hh:mm[:ss]. Ex: 2005/12/31-08:23:32, 10-08:32 ou 08:32',
2445     +'bac_READ_COMPLETE' => ' Vous pouvez choisir tous les dossiers et les fichiers que vous voulez restaurer dans la liste affichée (utiliser ctrl ou shift pour des sélections multiples). <br/> <b>Attention :</b> Si vous sélectionnez un répertoire, tous ses fichiers et sous-dossiers vont être restaurés.<p/> Par défaut, la version la plus récente des fichiers sélectionnés est restaurée mais si vous indiquez une date avec le format <i>~[ ~[ ~[aaaa/~]mm/~]jj-~]hh:mm~[:ss~]</i> le processus va uniquement restaurer la plus récente des versions ayant été modifiée <b>avant cette date</b>. ',
2446     +'bac_ERR_INVALID_SELDATE' => 'Le format de la date est invalide. Il doit être du style ~[ ~[ ~[aaaa/~]mm/~]jj-~]hh:mm~[:ss~]. Ex: 2005/12/31-08:23:32, 10-08:32 ou 08:32',
2447     'bac_SELECT_FILES_TO_RESTORE' => 'Sélectionnez les fichiers à restaurer',
2448     'bac_ERR_WHILE_UNMOUNTING' => 'Une erreur est survenue pendant le démontage du partage distant',
2449     'bac_ERR_DAR_CATALOG' => 'Erreur durant l\'utilisation du catalogue DAR',
2450     -'bac_COMPRESSION_LEVEL' => 'Niveau de compression de la sauvegarde [0-9]',
2451     +'bac_COMPRESSION_LEVEL' => 'Niveau de compression de la sauvegarde ~[0-9~]',
2452     'bac_FULL_ONLY_ON' => 'La sauvegarde complète est autorisée sur',
2453     'bac_ERR_INVALID_COMPRESSION' => 'Le niveau de compression doit être réglé entre 0 (aucune compression) et 9 (compression maximale)',
2454     'bac_DOW' => 'Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi Tous les jours',
2455     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_it.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_it.lex
2456     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_it.lex 2021-01-25 12:06:11.000000000 +0400
2457     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_it.lex 2021-01-25 22:43:14.266000000 +0400
2458     @@ -83,7 +83,7 @@
2459     'bac_NO_UID_FOR_NAME' => 'Impossibile ottenere l\'uid per l\'utente:',
2460     'bac_PAGE_REFRESH_IN' => ' Aggiornamento automatico ogni {$sec} secondi, o fare clic <a href="/server-manager/cgi-bin/backup">qui</a>. ',
2461     'Backup or restore' => 'Backup o ripristino',
2462     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Il server ha una quantità di dati superiore alla capacità del backup su desktop. </div> ',
2463     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Il server ha una quantità di dati superiore alla capacità del backup su desktop.',
2464     'bac_WORKSTN_BACKUPS_DISABLED' => ' I backup su workstation sono <b>disabilitati</b>. ',
2465     'bac_WORKSTN_BACKUPS_ENABLED' => ' I backup su workstation sono attualmente <b>abilitati</b>. ',
2466     'bac_WKBACKUPS_RUN_AT' => 'I backup su workstation inizieranno alle:',
2467     @@ -138,11 +138,11 @@
2468     'bac_SELECT_DATE_BEFORE' => 'Ripristina file aggiornati alla data',
2469     'bac_FILTER_EXPRESSION' => 'Nomi filtrati per',
2470     'bac_READ_COMPLETE' => ' Selezionare i file e le directory da ripristinare elencati nella lista (utilizzare ctrl o shift per selezioni multiple). <br/> <b>Attenzione :</b> Selezionando una directory, tutti i file e le sottodirectory in essa contenuti verranno ripristinati.<p/> Per default sarà ripristinata la versione più recente dei file selezionati, ma indicando una data nel formato <i>[ [ [yyyy/]mm/]dd-]hh:mm[:ss]</i> verrà ripristinata la versione antecedente <b>alla data indicata</b>. ',
2471     -'bac_ERR_INVALID_SELDATE' => 'Il formato della data non è valido, deve essere [ [ [yyyy/]mm/]dd-]hh:mm[:ss]. es.: 2005/12/31-08:23:32 oppure 10-08:32 oppure 08:32',
2472     +'bac_ERR_INVALID_SELDATE' => 'Il formato della data non è valido, deve essere ~[ ~[ ~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]. es.: 2005/12/31-08:23:32 oppure 10-08:32 oppure 08:32',
2473     'bac_SELECT_FILES_TO_RESTORE' => 'Selezionare i file da ripristinare',
2474     'bac_ERR_WHILE_UNMOUNTING' => 'Si è verificato un errore nell\'umount della condivisione remota',
2475     'bac_ERR_DAR_CATALOG' => 'Si è verificato un errore usando Dar',
2476     -'bac_COMPRESSION_LEVEL' => 'Livello di compressione del backup [0-9]',
2477     +'bac_COMPRESSION_LEVEL' => 'Livello di compressione del backup ~[0-9~]',
2478     'bac_FULL_ONLY_ON' => 'È possibile effettuare un backup completo',
2479     'bac_ERR_INVALID_COMPRESSION' => 'Il livello di compressione deve essere impostato tra 0 (nessuna compressione) e 9 (massima compressione)',
2480     'bac_DOW' => 'Domenica Lunedì Martedì Mercoledì Giovedì Venerdì Sabato Sempre',
2481     @@ -160,7 +160,7 @@
2482     'bac_PASSWORD' => 'La password è',
2483     'bac_WORKSTN_BACKUP_SETSNUM' => 'Numero di set di backup',
2484     'bac_WORKSTN_BACKUP_DAYSINSET' => 'Il numero di backup giornalieri contenuti in ogni set è',
2485     -'bac_WORKSTN_BACKUP_COMPRESSION' => 'Il livello di compressione del backup (0-9) è',
2486     +'bac_WORKSTN_BACKUP_COMPRESSION' => 'Il livello di compressione del backup ~[0-9~] è',
2487     'bac_WORKSTN_BACKUP_TIMEOUT' => 'Ogni sessione di backup giornaliero scade normalmente dopo',
2488     'bac_WORKSTN_BACKUP_INCONLY_TIMEOUT' => ' eccetto i backup full che scadono dopo 24 ore',
2489     'bac_WORKSTN_FULL_BACKUP_EVERYDAY' => 'Le sessioni di full backup (nel caso di nuovo set di backup) sono permesse tutti i giorni',
2490     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_nl.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_nl.lex
2491     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_nl.lex 2021-01-25 12:06:11.000000000 +0400
2492     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_nl.lex 2021-01-25 22:44:00.275000000 +0400
2493     @@ -83,7 +83,7 @@
2494     'bac_NO_UID_FOR_NAME' => 'Kan uid niet vinden voor gebruiker:',
2495     'bac_PAGE_REFRESH_IN' => ' Deze pagina vernieuwt naar het status scherm binnen {$sec} seconden, of klik <a href="/server-manager/cgi-bin/backup">hier</a>. ',
2496     'Backup or restore' => 'Backup of herstel',
2497     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Uw server heeft te veel data voor een betrouwbare backup naar bureaublad. </div> ',
2498     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Uw server heeft te veel data voor een betrouwbare backup naar bureaublad.',
2499     'bac_WORKSTN_BACKUPS_DISABLED' => ' Werkstation backups zijn <b>niet geactiveerd</b> ',
2500     'bac_WORKSTN_BACKUPS_ENABLED' => ' Werkstation backups zijn <b>geactiveerd</b>. ',
2501     'bac_WKBACKUPS_RUN_AT' => 'Werkstation backups starten om:',
2502     @@ -138,11 +138,11 @@
2503     'bac_SELECT_DATE_BEFORE' => 'Herstel meest recente voor',
2504     'bac_FILTER_EXPRESSION' => 'Namen gefilterd door',
2505     'bac_READ_COMPLETE' => ' U kunt de mappen en bestanden die hersteld moeten worden selecteren in de getoonde lijst (gebruik Ctrl of Shift voor veelvoudige keuze). <br/><b>Waarschuwing: </b>Als een map worden geselecteerd, worden alle onderliggende mappen en bestanden hersteld.<p/>Als standaard instelling worden de meest recent versies van de geselecteerde bestanden hersteld, maar als een datum in het formaat <i>[ [ [jjjj/]mm/]dd-]uu:mm[:ss]</i> is gespecificeerd word alleen de meest recente versie <b>voor de aangegeven datum</b> herstelt. ',
2506     -'bac_ERR_INVALID_SELDATE' => 'Datum formaat is niet correct, gewenst formaat [ [ [jjjj/]mm/]dd-]uu:mm[:ss]. bijvoorbeeld: 2005/12/31-08:23:32 of 10-08:32 of 08:32',
2507     +'bac_ERR_INVALID_SELDATE' => 'Datum formaat is niet correct, gewenst formaat ~[ ~[ ~[jjjj/~]mm/~]dd-~]uu:mm~[:ss~]. bijvoorbeeld: 2005/12/31-08:23:32 of 10-08:32 of 08:32',
2508     'bac_SELECT_FILES_TO_RESTORE' => 'Selecteer bestanden om te herstellen',
2509     'bac_ERR_WHILE_UNMOUNTING' => 'Fout opgetreden bij het ontladen van gedeelde map',
2510     'bac_ERR_DAR_CATALOG' => 'Fout bij het gebruiken van Dar cataloog',
2511     -'bac_COMPRESSION_LEVEL' => 'Backup compressie level [0-9]',
2512     +'bac_COMPRESSION_LEVEL' => 'Backup compressie level ~[0-9~]',
2513     'bac_FULL_ONLY_ON' => 'Volledige backup is toegelaten op',
2514     'bac_ERR_INVALID_COMPRESSION' => 'Compressie level moet zich tussen 0 (geen compressie) en 9 (maximum compressie) bevinden',
2515     'bac_DOW' => 'Zondag Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag Alle dagen',
2516     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt-br.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt-br.lex
2517     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt-br.lex 2021-01-25 12:06:11.000000000 +0400
2518     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt-br.lex 2021-01-25 00:17:07.000000000 +0400
2519     @@ -82,8 +82,7 @@
2520     'bac_SERVER_WILL_REBOOT' => 'Seu servidor irá reinicializar agora.',
2521     'bac_NO_UID_FOR_NAME' => 'Incapaz de achar uid para usuário chamado:',
2522     'bac_PAGE_REFRESH_IN' => ' Esta página irá recarregar em {$sec} segundos, ou clique <a href="/server-manager/cgi-bin/backup">aqui</a>. ',
2523     -'bac_Backup or restore' => 'Backup ou restauração',
2524     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Seu servidor tem muitos dados para que um backup para desktop seja confiável. </div> ',
2525     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Seu servidor tem muitos dados para que um backup para desktop seja confiável.',
2526     'bac_WORKSTN_BACKUPS_DISABLED' => ' O backup para micro da rede local está <b>desativado</b> ',
2527     'bac_WORKSTN_BACKUPS_ENABLED' => ' O backup para micro da rede local está atualmente <b>habilitado</b>. ',
2528     'bac_WKBACKUPS_RUN_AT' => 'Backup para micro da rede local será executado às:',
2529     @@ -182,3 +181,4 @@
2530     'bac_local removable disk' => 'disco local removível',
2531     'bac_Mounted disk' => 'Montado',
2532     'bac_ERROR_WHEN_TESTING_REMOTE_SERVER' => 'Os parâmetros foram salvos, contudo o servidor remoto não foi encontrado, por favor verifique suas configurações.',
2533     +'Backup or restore' => 'Backup ou restauração',
2534     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt.lex
2535     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt.lex 2021-01-25 12:06:11.000000000 +0400
2536     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_pt.lex 2021-01-25 22:44:33.035000000 +0400
2537     @@ -83,7 +83,7 @@
2538     'bac_NO_UID_FOR_NAME' => 'Incapaz de achar uid para usuário chamado:',
2539     'bac_PAGE_REFRESH_IN' => ' Esta página irá recarregar em {$sec} segundos, ou click <a href="/server-manager/cgi-bin/backup">aqui</a>. ',
2540     'Backup or restore' => 'Backup ou restauração',
2541     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Seu servidor tem muitos dados para que um backup para desktop seja confiável. </div> ',
2542     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Seu servidor tem muitos dados para que um backup para desktop seja confiável.',
2543     'bac_WORKSTN_BACKUPS_DISABLED' => ' O backup para micro da rede local está <b>desativado</b> ',
2544     'bac_WORKSTN_BACKUPS_ENABLED' => ' O backup para micro da rede local está atualmente <b>habilitado</b>. ',
2545     'bac_WKBACKUPS_RUN_AT' => 'Backup para micro da rede local será executado às:',
2546     @@ -138,11 +138,11 @@
2547     'bac_SELECT_DATE_BEFORE' => 'Restaurar arquivos mais recentes que',
2548     'bac_FILTER_EXPRESSION' => 'Nomes filtrados por',
2549     'bac_READ_COMPLETE' => ' Você pode escolher todos os diretórios e arquivos que você não quer restaurar na lista mostrada (use CTRL ou SHIFT para seleção múltipla). <br/> <b>ATENÇÃO :</b> Se você selecionar um diretório, todos arquivos e subdiretórios contidos abaixo dele serão restaurados.<p/> O padrão é que somente a versão mais recente dos arquivos selecionados seja restaurada, mas se você especificar uma data no formato <i>[ [ [yyyy/]mm/]dd-]hh:mm[:ss]</i> o processo restaurará apenas a versão mais recente modificada<b>ANTES da data fornecida</b>. ',
2550     -'bac_ERR_INVALID_SELDATE' => 'Formato de data inválido, deve ser[ [ [yyyy/]mm/]dd-]hh:mm[:ss]. ie: 2005/12/31-08:23:32 or 10-08:32 or 08:32',
2551     +'bac_ERR_INVALID_SELDATE' => 'Formato de data inválido, deve ser ~[ ~[ ~[yyyy/~]mm/~]dd-~]hh:mm~[:ss~]. ie: 2005/12/31-08:23:32 or 10-08:32 or 08:32',
2552     'bac_SELECT_FILES_TO_RESTORE' => 'Selecione arquivos para restaurar',
2553     'bac_ERR_WHILE_UNMOUNTING' => 'Ocorreu um erro quando desmontando o compartilhamento remoto',
2554     'bac_ERR_DAR_CATALOG' => 'Ocorreu um erro quando usando o catalogo do DAR',
2555     -'bac_COMPRESSION_LEVEL' => 'Nivel de compressão do backup [0-9]',
2556     +'bac_COMPRESSION_LEVEL' => 'Nivel de compressão do backup ~[0-9~]',
2557     'bac_FULL_ONLY_ON' => 'Backup completo é permitido em',
2558     'bac_ERR_INVALID_COMPRESSION' => 'O nível de compressão deve ser definido entre 0 (sem compressão) e 9 (compressão máxima)',
2559     'bac_DOW' => 'Domingo Segunda Terça Quarta Quinta Sexta Sábado TodosDias',
2560     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_ru.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_ru.lex
2561     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_ru.lex 2021-01-25 12:06:11.000000000 +0400
2562     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Backup/backup_ru.lex 2021-01-25 00:17:47.000000000 +0400
2563     @@ -83,7 +83,7 @@
2564     'bac_NO_UID_FOR_NAME' => 'Не удалось получить uid для пользователя с именем:',
2565     'bac_PAGE_REFRESH_IN' => ' Эта страница обновит отображение состояния в течении {$sec} секунд, или нажимте <a href="/server-manager/cgi-bin/backup">здесь</a>. ',
2566     'bac_Backup or restore' => 'Резервное копирование или восстановление',
2567     -'bac_BACKUP_DESKTOP_TOO_BIG' => ' <div class="error"> Your server has too much data for a reliable backup to desktop. </div> ',
2568     +'bac_BACKUP_DESKTOP_TOO_BIG' => 'Your server has too much data for a reliable backup to desktop.',
2569     'bac_WORKSTN_BACKUPS_DISABLED' => ' Резервные копии рабочей станции <b>отключены</b> ',
2570     'bac_WORKSTN_BACKUPS_ENABLED' => ' Резервные копии рабочей станции в настоящее время <b>включены</b>. ',
2571     'bac_WKBACKUPS_RUN_AT' => 'Regular workstation backups will run at:',
2572     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Reboot/reboot_fr.lex smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Reboot/reboot_fr.lex
2573     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Reboot/reboot_fr.lex 2021-01-25 12:06:11.000000000 +0400
2574     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Reboot/reboot_fr.lex 2021-01-27 00:17:02.356000000 +0400
2575     @@ -4,6 +4,7 @@
2576     'rbo_DESC_REBOOT' => 'Votre serveur a commencé le processus de redémarrage.',
2577     'rbo_RECONFIGURE_SUCCEEDED' => 'Lancement réussi de la requête de reconfiguration.',
2578     'rbo_DESC_RECONFIGURE' => 'Votre serveur a commencé le processus de reconfiguration et de redémarrage.',
2579     +'rbo_SHUTDOWN_SUCCEEDED' => 'Lancement réussi de la requête d\'arrêt.',
2580     'rbo_DESC_SHUTDOWN' => 'Votre serveur a commencé le processus d\'arrêt. L\'exécution complète de ce processus pourra durer quelques minutes, après lesquelles vous pourrez couper l\'alimentation.',
2581     'rbo_LABEL_REBOOT' => 'Action',
2582     'rbo_DESCRIPTION' => ' Vous pouvez arrêter, redémarrer ou effectuer une reconfiguration complète de votre serveur à partir de cette page. Vous devez lancer la séquence d\'arrêt avant de couper l\'alimentation. L\'exécution de ces fonctions peut durer quelques minutes. Lorsque vous cliquerez sur "<b>Exécuter</b>" l\'opération se lancera immédiatement, alors soyez prêt ! ',
2583     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N.pm
2584     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr/I18N.pm 2020-11-19 11:53:26.000000000 +0400
2585     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr/I18N.pm 2021-01-25 14:16:26.044000000 +0400
2586     @@ -1,5 +1,3 @@
2587     -#!/usr/bin/perl -wT
2588     -
2589     package SrvMngr::I18N;
2590    
2591     use strict;
2592     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr.pm smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr.pm
2593     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/lib/SrvMngr.pm 2021-01-25 12:06:11.000000000 +0400
2594     +++ smeserver-manager-0.1.2/root/usr/share/smanager/lib/SrvMngr.pm 2021-01-27 21:32:20.934000000 +0400
2595     @@ -23,7 +23,7 @@
2596     use SrvMngr::Model::Main;
2597    
2598    
2599     -our $VERSION = '1.205';
2600     +our $VERSION = '1.206';
2601     $VERSION = eval $VERSION;
2602    
2603     use Exporter 'import';
2604     @@ -54,6 +54,8 @@
2605    
2606     $self->mode( $self->config->{mode} || 'production' ); #'development'
2607    
2608     + $ENV{'MOJO_SMANAGER_DEBUG'} = $self->config->{debug} || 0;
2609     +
2610     $self->setup_plugins;
2611    
2612     $self->setup_helpers;
2613     @@ -65,6 +67,10 @@
2614     $self->setup_routing;
2615    
2616     $self->setup_hooks;
2617     +
2618     + # no data in cache
2619     + $self->renderer->cache->max_keys(0);
2620     +
2621     }
2622    
2623    
2624     @@ -120,7 +126,7 @@
2625     my $self = shift;
2626     my $message = shift || $self->l('acs_NO');
2627     $self->flash( error => $message );
2628     - $self->redirect_to( $self->home_page );
2629     + $self->redirect_to( $self->home_page, status => 403 );
2630     return 0;
2631     });
2632    
2633     @@ -166,7 +172,7 @@
2634     $self->helper(log_req => sub {
2635    
2636     my $c = shift;
2637     - my $mess = shift;
2638     + my $mess = shift || '';
2639    
2640     my $method = $c->req->method;
2641     my $url = $c->req->url;
2642     @@ -613,7 +619,7 @@
2643     # my $lang = (split(/,/, $c->tx->req->headers->accept_language))[0];
2644     ## convert xx_XX lang format to xx-xx + delete .UTFxx + lowercase
2645     # $lang =~ s/_(.*)\..*$/-${1}/; # just keep 'en-us'
2646     - $lang = lc( substr( $lang,0,2 ) ); # just keep 'en'
2647     + ##$lang = lc( substr( $lang,0,2 ) ); # just keep 'en'
2648    
2649     $panel = '/initial' if ($panel eq '/' or $panel eq '');
2650    
2651     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/script/srvmngr smeserver-manager-0.1.2/root/usr/share/smanager/script/srvmngr
2652     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/script/srvmngr 2020-11-19 11:53:26.000000000 +0400
2653     +++ smeserver-manager-0.1.2/root/usr/share/smanager/script/srvmngr 2021-01-27 21:30:06.774000000 +0400
2654     @@ -25,6 +25,7 @@
2655     #Application
2656     $ENV{MOJO_APP} ||= 'SrvMngr';
2657     $ENV{MOJO_REVERSE_PROXY} ||= '/smanager';
2658     +$ENV{MOJO_SMANAGER_DEBUG} ||= 0;
2659     $ENV{SRVMNGR_HOME} ||= "$FindBin::Bin/..";
2660    
2661     # Start command
2662     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_desktop_backup.html.ep.inac smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_desktop_backup.html.ep.inac
2663     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_desktop_backup.html.ep.inac 2020-11-19 11:53:26.000000000 +0400
2664     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_desktop_backup.html.ep.inac 1970-01-01 04:00:00.000000000 +0400
2665     @@ -1,28 +0,0 @@
2666     -% layout 'default', title => "Sme server 2 - desktop-backup";
2667     -
2668     -% content_for 'module' => begin
2669     -
2670     -<div id="module">
2671     - % if ($config->{debug} == 1) {
2672     - <p>
2673     - %= dumper $c->current_route
2674     - %= dumper $bac_datas
2675     - </p>
2676     - % }
2677     -
2678     - % if ( stash 'error' ) {
2679     - <br><div class=sme-error>
2680     - %= $c->render_to_string(inline => stash 'error')
2681     - </div>
2682     - %}
2683     -
2684     - <h1><%= $title%></h1>
2685     -
2686     - <h2>
2687     - %=l 'bac_DESKTOP_BACKUP'
2688     - </h2><br>
2689     - %= hidden_field 'Function' => $bac_datas->{'function'}
2690     -
2691     -</div>
2692     -
2693     -% end
2694     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/backdown.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/backdown.html.ep
2695     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/backdown.html.ep 1970-01-01 04:00:00.000000000 +0400
2696     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/backdown.html.ep 2021-01-16 23:49:54.000000000 +0400
2697     @@ -0,0 +1,56 @@
2698     +<%
2699     +
2700     + my $backups = esmith::BackupHistoryDB->open;
2701     + my $now = time();
2702     + my $backup_rec = $backups->new_record($now, {
2703     + type => 'backup_record', BackupType => 'desktop',
2704     + StartEpochTime => $now,
2705     + });
2706     +
2707     + # Dump the current mysql tables so that they are part of the image.
2708     + # The events handle cases where mysqld is not enabled, and/or is not running.
2709     + my $status = system("/sbin/e-smith/signal-event", "pre-backup", "desktop");
2710     + if ($status) {
2711     + desktopBackupRecordStatus($backup_rec, 'pre-backup', $status);
2712     + return ($c->l('bac_OPERATION_STATUS_REPORT').
2713     + $c->l('bac_ERR_PRE_BACKUP'));
2714     + }
2715     +
2716     + my $clvl = $c->stash('compressionlevel');
2717     + my $cmd = "/bin/tar --directory / --create @{$c->stash('directories')} --file=-"
2718     + . "@{$c->stash('exclude')} | /usr/bin/gzip $clvl ";
2719     +
2720     + my $success = open my $fh, '-|', $cmd;
2721     + unless ($success) { return "Error dowload command."; };
2722     +
2723     + # Write chunk
2724     + $c->res->headers->content_type('application/x-tar');
2725     + $c->res->headers->content_disposition(qq/attachment; filename="smeserver.tgz"/);
2726     +
2727     + my $cb;
2728     + $cb = sub {
2729     + my $c = shift;
2730     + my $size = 500 * 1024;
2731     + my $length = sysread($fh, my $buffer, $size);
2732     + unless ($length) {
2733     + close $fh;
2734     + undef $cb;
2735     + $c->finish;
2736     + return;
2737     + }
2738     + $c->write_chunk($buffer, $cb);
2739     + };
2740     + $c->$cb;
2741     +
2742     + # Remove the dumped tables.
2743     + $status = system("/sbin/e-smith/signal-event", "post-backup", "desktop");
2744     + if ($status) {
2745     + desktopBackupRecordStatus($backup_rec, 'post-backup', $status);
2746     + die ($c->l('bac_ERR_POST_BACKUP'),"\n");
2747     + }
2748     +
2749     + $now = time();
2750     + $backup_rec->set_prop('EndEpochTime', "$now");
2751     + $backup_rec->set_prop('Result', "0");
2752     +
2753     +%>
2754     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_tape_configure.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_tape_configure.html.ep
2755     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_tape_configure.html.ep 2020-11-19 11:53:26.000000000 +0400
2756     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_tape_configure.html.ep 2021-01-25 22:34:56.434000000 +0400
2757     @@ -71,16 +71,13 @@
2758     % param 'ReminderAMPM' => $bac_datas->{reminderAMPM} unless param 'ReminderAMPM';
2759     %= select_field 'ReminderAMPM' => ['AM', 'PM'], class => 'input'
2760     </span>
2761     - </p>
2762     -
2763     - <br>
2764     + </p><br>
2765    
2766     %= hidden_field 'Function' => $bac_datas->{'function'}
2767     -
2768     + <div class='center'>
2769     %= submit_button $c->l('bac_UPDATE_CONF'), class => 'action'
2770     + </div>
2771    
2772     % end
2773     -
2774     </div>
2775     -
2776     % end
2777     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_tape_restore.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_tape_restore.html.ep
2778     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_tape_restore.html.ep 2020-11-19 11:53:26.000000000 +0400
2779     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_tape_restore.html.ep 2021-01-25 22:35:24.664000000 +0400
2780     @@ -30,10 +30,10 @@
2781    
2782     %= hidden_field 'Function' => $bac_datas->{'function'}
2783    
2784     + <div class='center'>
2785     %= submit_button $c->l('bac_RESTORE_FROM_TAPE'), class => 'action'
2786     + </div>
2787    
2788     % end
2789     -
2790     </div>
2791     -
2792     % end
2793     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/backup.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/backup.html.ep
2794     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/backup.html.ep 2020-11-19 11:53:26.000000000 +0400
2795     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/backup.html.ep 2021-01-25 00:32:02.000000000 +0400
2796     @@ -10,6 +10,11 @@
2797     </p>
2798     % }
2799    
2800     + % if ( stash 'warning' ) {
2801     + <br><div class=sme-warning>
2802     + %= $c->render_to_string(inline => stash 'warning')
2803     + </div>
2804     + %}
2805     % if ( stash 'error' ) {
2806     <br><div class=sme-error>
2807     %= $c->render_to_string(inline => stash 'error')
2808     @@ -17,10 +22,9 @@
2809     %}
2810    
2811     <h1><%= $title%></h1>
2812     -
2813     - <br>Still incomplete click here for previous version -->
2814     + <!--br>Still incomplete click here for previous version
2815     <a href="/server-manager/cgi-bin/backup" target='_blank'><b>(Previous Backup version)</b></a>
2816     - <br>
2817     + <br-->
2818    
2819     <%= $c->render_to_string(inline => (l 'bac_BACKUP_DESC_DAR', $bac_datas->{module},
2820     $bac_datas->{dumpsize}, $bac_datas->{tarsize})) %>
2821     @@ -34,7 +38,7 @@
2822     <p><span class=label>
2823     %=l 'bac_TAPE_BACKUPS',
2824     </span><span class=data2>
2825     - %= $bac_datas->{'backupStatus'}.'.'
2826     + %= $c->l(uc($bac_datas->{'backupStatus'})).'.'
2827     </span>
2828     % if ( $bac_datas->{'backupStatus'} eq 'enabled' ) {
2829     %= $c->l('bac_BACKUPS_RUN_AT')
2830     @@ -49,7 +53,7 @@
2831     <p><span class=label>
2832     %=l 'bac_WORKSTN_BACKUPS',
2833     </span><span class=data2>
2834     - %= $bac_datas->{'backupwkStatus'}.'.'
2835     + %= $c->l(uc($bac_datas->{'backupwkStatus'})).'.'
2836     </span>
2837     % if ( $bac_datas->{'backupwkStatus'} eq 'enabled' ) {
2838     %= $c->l('bac_WKBACKUPS_RUN_AT')
2839     @@ -66,7 +70,9 @@
2840     </span></p>
2841    
2842     <br>
2843     + <div class='center'>
2844     %= submit_button $c->l('PERFORM'), class => 'action'
2845     + </div>
2846    
2847     % end
2848    
2849     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_configure1.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_configure1.html.ep
2850     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_configure1.html.ep 1970-01-01 04:00:00.000000000 +0400
2851     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_configure1.html.ep 2021-01-24 17:37:11.000000000 +0400
2852     @@ -0,0 +1,156 @@
2853     +% layout 'default', title => "Sme server 2 - backup - conf";
2854     +
2855     +% content_for 'module' => begin
2856     +
2857     +<div id="module">
2858     + % if ($config->{debug} == 1) {
2859     + <p>
2860     + %= dumper $c->current_route
2861     + %= dumper $bac_datas
2862     + </p>
2863     + % }
2864     +
2865     + % if ( stash 'error' ) {
2866     + <br><div class=sme-error>
2867     + %= $c->render_to_string(inline => stash 'error')
2868     + </div>
2869     + %}
2870     +
2871     + <h1><%= $title%></h1>
2872     +
2873     + <h2>
2874     + %=l 'bac_CONFIGURE_WORKSTN_BACKUP'
2875     + </h2>
2876     +
2877     + %= $c->render_to_string(inline => (l 'bac_CONFIGURE_WORKSTN_BACKUP_DESC'))
2878     +
2879     + %= form_for '/backupd' => (method => 'POST') => begin
2880     +
2881     + <p>
2882     + <span class=label>
2883     + %=l 'bac_ENABLE_WORKSTN_BACKUP'
2884     + </span><span class=data>
2885     + % if ( $bac_datas->{status} eq 'checked' ) {
2886     + <input type='checkbox' name='Workstnbackup' checked >
2887     + %} else {
2888     + %= check_box 'Workstnbackup'
2889     + %}
2890     + </span>
2891     +
2892     + </p>
2893     + <p><h3>
2894     + %= l 'bac_WORKSTATION_BACKUP_DEST'
2895     + </h3><br>
2896     +
2897     + % if ( $bac_datas->{vfstype} =~ m/cifs|nfs/s ) {
2898     + <span class=label>
2899     + %=l 'bac_WORKSTN_NAME'
2900     + </span><span class=data>
2901     + % param 'BackupwkStation' => $bac_datas->{station} unless param 'BackupwkStation';
2902     + %= text_field 'BackupwkStation', size => 20, class => 'input'
2903     + </span><br>
2904     + %}
2905     + % if ( $bac_datas->{vfstype} eq 'usb' ) {
2906     + <span class=label>
2907     + %=l 'bac_local removable disk'
2908     + </span><span class=data>
2909     + % param 'BackupwkFolder' => $bac_datas->{mount} unless param 'BackupwkFolder';
2910     + %= select_field 'BackupwkFolder' => $c->get_BackupwkDest_options( $bac_datas->{vfstype}), class => 'input'
2911     + </span><br>
2912     + % } elsif ( $bac_datas->{vfstype} eq 'mnt') {
2913     + <span class=label>
2914     + %=l 'bac_Mounted disk'
2915     + </span><span class=data>
2916     + % param 'BackupwkFolder' => $bac_datas->{folder} unless param 'BackupwkFolder';
2917     + %= select_field 'BackupwkFolder' => $c->get_BackupwkDest_options( $bac_datas->{vfstype}), class => 'input'
2918     + </span><br>
2919     + % } else {
2920     + <span class=label>
2921     + %=l 'bac_SHARED_FOLDER_NAME'
2922     + </span><span class=data>
2923     + % param 'BackupwkFolder' => $bac_datas->{folder} unless param 'BackupwkFolder';
2924     + %= text_field 'BackupwkFolder', size => 20, class => 'input'
2925     + </span><br>
2926     + %}
2927     + % if ( $bac_datas->{vfstype} eq 'cifs' ) {
2928     + <span class=label>
2929     + %=l 'bac_WORKSTN_LOGIN'
2930     + </span><span class=data>
2931     + % param 'BackupwkLogin' => $bac_datas->{login} unless param 'BackupwkLogin';
2932     + %= text_field 'BackupwkLogin', size => 12, class => 'input'
2933     + </span><br><span class=label>
2934     + %=l 'bac_PASSWORD'
2935     + </span><span class=data>
2936     + % param 'BackupwkPassword' => $bac_datas->{password} unless param 'BackupwkPassword';
2937     + %= password_field 'BackupwkPassword', size => 12, class => 'input'
2938     + </span>
2939     + %}
2940     + </p><br><h3>
2941     + %= l 'bac_WORKSTN_BACKUP_SETTINGS'
2942     + </h3><br>
2943     +
2944     + <p><span class=label>
2945     + %=l 'bac_NUMBER_OF_SETS'
2946     + </span><span class=data>
2947     + % param 'SetsNumber' => $bac_datas->{setsNumber} unless param 'SetsNumber';
2948     + %= text_field 'SetsNumber', size => '3'
2949     + </span>
2950     + %=l 'bac_NUMBER_OF_FILES_IN_SET'
2951     + <span class=data>
2952     + % param 'Filesinset' => $bac_datas->{filesinset} unless param 'Filesinset';
2953     + %= text_field 'Filesinset', size => '3'
2954     + </span></p>
2955     +
2956     + <p>
2957     + <span class=label>
2958     + %=l 'bac_WORKSTN_BACKUP_TIME'
2959     + </span><span class=data>
2960     + % param 'BackupwkHour' => $bac_datas->{hour} unless param 'BackupwkHour';
2961     + %= text_field 'BackupwkHour', size => '2'
2962     + % param 'BackupwkMin' => $bac_datas->{min} unless param 'BackupwkMin';
2963     + %= text_field 'BackupwkMin', size => '2'
2964     + </span>
2965     + %=l 'AM/PM:'
2966     + <span class=data>
2967     + % param 'BackupwkAMPM' => $bac_datas->{ampm} unless param 'BackupwkAMPM';
2968     + %= select_field 'BackupwkAMPM' => ['AM', 'PM'], class => 'input'
2969     + </span>
2970     + </p>
2971     +
2972     + <p><span class=label>
2973     + %=l 'bac_WORKSTN_TIMEOUT'
2974     + </span><span class=data>
2975     + % param 'BackupwkTimeout' => $bac_datas->{timeout} unless param 'BackupwkTimeout';
2976     + %= text_field 'BackupwkTimeout', size => '2'
2977     + </span>
2978     + %=l 'bac_INC_ONLY_TIMEOUT'
2979     + <span class=data>
2980     + % if ( $bac_datas->{incOnlyTimeout} eq 'checked' ) {
2981     + <input type='checkbox' name='IncOnlyTimeout' checked >
2982     + %} else {
2983     + %= check_box 'IncOnlyTimeout'
2984     + %}
2985     + </span></p>
2986     +
2987     + <p>
2988     + <span class=label>
2989     + %=l 'bac_COMPRESSION_LEVEL'
2990     + </span><span class=data>
2991     + % param 'Compression' => $bac_datas->{compression} unless param 'Compression';
2992     + %= text_field 'Compression', size => '1'
2993     + </span>
2994     + %=l 'bac_FULL_ONLY_ON'
2995     + <span class=data>
2996     + % param 'Dof' => $bac_datas->{dof} unless param 'Dof';
2997     + %= select_field 'Dof' => $c->get_dow_list(), class => 'input'
2998     + </p><br>
2999     +
3000     +
3001     + %= hidden_field 'Function' => $bac_datas->{function}
3002     + %= hidden_field 'VFSType' => $bac_datas->{vfstype}
3003     + <div class='center'>
3004     + %= submit_button $c->l('bac_UPDATE_CONF'), class => 'action'
3005     + </div>
3006     + % end
3007     +</div>
3008     +% end
3009     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_configure.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_configure.html.ep
3010     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_configure.html.ep 2020-11-19 11:53:26.000000000 +0400
3011     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_configure.html.ep 2021-01-24 19:59:07.000000000 +0400
3012     @@ -18,7 +18,7 @@
3013    
3014     <h1><%= $title%></h1>
3015    
3016     - %= form_for '/backupd' => (method => 'POST') => begin
3017     + %= form_for '/backup' => (method => 'POST') => begin
3018    
3019     <h2>
3020     %=l 'bac_CONFIGURE_WORKSTN_BACKUP'
3021     @@ -31,7 +31,7 @@
3022     %= $bac_datas->{status}
3023     </span><br>
3024    
3025     - %= $c->render_to_string(inline => $c->getWorkstnBackupConfig())
3026     + %= $c->render_to_string(inline => $c->workstnBackupConfig())
3027    
3028     <p><h3>
3029     %= l 'bac_WORKSTATION_BACKUP_SETCONF'
3030     @@ -43,8 +43,10 @@
3031     %= select_field 'VFSType' => $c->get_VFSType_options(), class => 'input'
3032     </span></p>
3033    
3034     - %= hidden_field 'Function' => $bac_datas->{'function'}
3035     + %= hidden_field 'Function' => $bac_datas->{'function'} . '1'
3036     + <div class='center'>
3037     %= submit_button $c->l('NEXT'), class => 'action'
3038     + </div>
3039    
3040     % end
3041    
3042     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_restore1.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_restore1.html.ep
3043     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_restore1.html.ep 1970-01-01 04:00:00.000000000 +0400
3044     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_restore1.html.ep 2021-01-26 21:27:16.000000000 +0400
3045     @@ -0,0 +1,38 @@
3046     +% layout 'default', title => "Sme server 2 - restore";
3047     +
3048     +% content_for 'module' => begin
3049     +
3050     +<div id="module">
3051     + % if ($config->{debug} == 1) {
3052     + <p>
3053     + %= dumper $c->current_route
3054     + %= dumper $bac_datas
3055     + </p>
3056     + % }
3057     +
3058     + % if ( stash 'error' ) {
3059     + <br><div class=sme-error>
3060     + %= $c->render_to_string(inline => stash 'error')
3061     + </div>
3062     + %}
3063     +
3064     + <h1><%= $title%></h1>
3065     +
3066     + %= form_for '/backupd' => (method => 'POST') => begin
3067     +
3068     + <h2>
3069     + %=l 'bac_WORKSTN_RESTORE'
3070     + </h2>
3071     + <p>
3072     + %= $c->render_to_string(inline => $bac_datas->{restore_log})
3073     + </p><p>
3074     + %=l 'bac_YOU_MUST_REBOOT'
3075     + </p>
3076     + %= hidden_field 'Function' => $bac_datas->{'function'}
3077     + <div class='center'>
3078     + %= submit_button $c->l('bac_REBOOT'), class => 'action'
3079     + </div>
3080     + % end
3081     +</div>
3082     +
3083     +% end
3084     \ Pas de fin de ligne à la fin du fichier
3085     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_restore.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_restore.html.ep
3086     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_restore.html.ep 2020-11-19 11:53:26.000000000 +0400
3087     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_restore.html.ep 2021-01-25 22:57:21.922000000 +0400
3088     @@ -1,4 +1,4 @@
3089     -% layout 'default', title => "Sme server 2 - backup";
3090     +% layout 'default', title => "Sme server 2 - restore";
3091    
3092     % content_for 'module' => begin
3093    
3094     @@ -21,17 +21,26 @@
3095     %= form_for '/backupd' => (method => 'POST') => begin
3096    
3097     <h2>
3098     - %=l 'bac_RESTORE_CONF_FROM_WORKSTN'
3099     + %=l 'bac_WORKSTN_RESTORE'
3100     </h2>
3101    
3102     - %= $c->render_to_string(inline => (l 'bac_RESTORE_CONF_FROM_WORKSTN_DESC'))
3103     + <br><br>
3104     + % if ($bac_datas->{status} ne 'enabled') {
3105     + %= $c->render_to_string(inline => (l 'bac_CONFIGURATION_TO_BE_DONE'))
3106     + % } else {
3107     + %= $c->render_to_string(inline => (l 'bac_RESTORE_CONF_FROM_WORKSTN_DESC') . ' ' . $c->get_shared_folder_to_verify())
3108     + %}
3109     +
3110     + <br><br><span class=label>
3111     + %=l 'bac_SELECT_BACKUP_FILE'
3112     + </span><span class=data>
3113     + %= select_field 'Backupset' => $c->get_Backupset_options(), class => 'input'
3114     + </span><br><br>
3115    
3116     - <br>
3117     %= hidden_field 'Function' => $bac_datas->{'function'}
3118     + <div class='center'>
3119     %= submit_button $c->l('bac_RESTORE_FROM_WORKSTN'), class => 'action'
3120     -
3121     + </div>
3122     % end
3123     -
3124     </div>
3125     -
3126     % end
3127     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore1.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore1.html.ep
3128     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore1.html.ep 1970-01-01 04:00:00.000000000 +0400
3129     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore1.html.ep 2021-01-25 20:18:40.000000000 +0400
3130     @@ -0,0 +1,51 @@
3131     +% layout 'default', title => "Sme server 2 - backup";
3132     +
3133     +% content_for 'module' => begin
3134     +
3135     +<div id="module">
3136     + % if ($config->{debug} == 1) {
3137     + <p>
3138     + %= dumper $c->current_route
3139     + %= dumper $bac_datas
3140     + </p>
3141     + % }
3142     +
3143     + % if ( stash 'error' ) {
3144     + <br><div class=sme-error>
3145     + %= $c->render_to_string(inline => stash 'error')
3146     + </div>
3147     + %}
3148     +
3149     + <h1><%= $title%></h1>
3150     +
3151     +
3152     + <h2><%=l 'bac_WORKSTN_SELECTIVE_RESTORE' %></h2><br>
3153     +
3154     + %= $c->render_to_string(inline => (l 'bac_READ_COMPLETE'))
3155     +
3156     + %= form_for '/backupd' => (method => 'POST') => begin
3157     +
3158     + <br><span class=label>
3159     + %=l 'bac_SELECT_FILES_TO_RESTORE'
3160     + </span><span class=data>
3161     + %= select_field 'Restorefiles' => $c->get_Restorefiles_options($bac_datas->{'filterexp'},$bac_datas->{'backupset'}), class => 'input', multiple => 1, size => 15
3162     + </span><br>
3163     +
3164     + <br><span class=label>
3165     + %=l 'bac_SELECT_DATE_BEFORE'
3166     + </span><span class=data>
3167     + %= text_field 'Seldatebefore', size => 32, class => 'input'
3168     + </span><br>
3169     + <br>
3170     + %= hidden_field 'Function' => $bac_datas->{'function'}
3171     + %= hidden_field 'Backupset' => $bac_datas->{'backupset'}
3172     + %= hidden_field 'Filterexp' => $bac_datas->{'filterexp'}
3173     +
3174     + <div class='center'>
3175     + %= submit_button $c->l('PERFORM'), class => 'action'
3176     + </div>
3177     +
3178     + % end
3179     +
3180     +</div>
3181     +% end
3182     \ Pas de fin de ligne à la fin du fichier
3183     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore2.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore2.html.ep
3184     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore2.html.ep 1970-01-01 04:00:00.000000000 +0400
3185     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore2.html.ep 2021-01-21 16:51:14.000000000 +0400
3186     @@ -0,0 +1,34 @@
3187     +% layout 'default', title => "Sme server 2 - backup";
3188     +
3189     +% content_for 'module' => begin
3190     +
3191     +<div id="module">
3192     + % if ($config->{debug} == 1) {
3193     + <p>
3194     + %= dumper $c->current_route
3195     + %= dumper $bac_datas
3196     + </p>
3197     + % }
3198     +
3199     + % if ( stash 'error' ) {
3200     + <br><div class=sme-error>
3201     + %= $c->render_to_string(inline => stash 'error')
3202     + </div>
3203     + %}
3204     +
3205     + <h1><%= $title%></h1>
3206     + <h2><%=l 'bac_WORKSTN_SELECTIVE_RESTORE' %></h2>
3207     + <br>
3208     + %= $c->render_to_string(inline => $bac_datas->{restore_log})
3209     + <br>
3210     +
3211     + %= form_for '/backupd' => (method => 'POST') => begin
3212     + %= hidden_field 'Function' => $bac_datas->{'function'}
3213     + <div class='center'>
3214     + %= submit_button $c->l('NEXT'), class => 'action'
3215     + </div>
3216     +
3217     + % end
3218     +
3219     +</div>
3220     +% end
3221     \ Pas de fin de ligne à la fin du fichier
3222     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore.html.ep
3223     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore.html.ep 2020-11-19 11:53:26.000000000 +0400
3224     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_sel_restore.html.ep 2021-01-20 18:14:49.000000000 +0400
3225     @@ -20,16 +20,28 @@
3226    
3227     %= form_for '/backupd' => (method => 'POST') => begin
3228    
3229     - <h2>
3230     - %=l 'bac_WORKSTN_SELECTIVE_RESTORE'
3231     - </h2>
3232     -
3233     + <h2><%=l 'bac_WORKSTN_SEL_RESTORE' %></h2>
3234    
3235     - %= $c->render_to_string(inline => (l 'bac_XXX_DESC'))
3236     + %= $c->render_to_string(inline => (l 'bac_WORKSTN_SEL_REST_DESC') . ' ' . $c->get_shared_folder_to_verify())
3237    
3238     + <h3><%=l 'bac_BACKUP_CHOICE' %></h3>
3239     +
3240     + <br><span class=label>
3241     + %=l 'bac_SELECT_BACKUP_FILE'
3242     + </span><span class=data>
3243     + %= select_field 'Backupset' => $c->get_Restoreset_options(), class => 'input'
3244     + </span><br>
3245     +
3246     + <br><span class=label>
3247     + %=l 'bac_FILTER_EXPRESSION'
3248     + </span><span class=data>
3249     + %= text_field 'Filterexp', size => 32, class => 'input'
3250     + </span><br>
3251     <br>
3252     %= hidden_field 'Function' => $bac_datas->{'function'}
3253     - %= submit_button $c->l('bac_RESTORE_FROM_WORKSTN'), class => 'action'
3254     + <div class='center'>
3255     + %= submit_button $c->l('PERFORM'), class => 'action'
3256     + </div>
3257    
3258     % end
3259    
3260     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_verify1.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_verify1.html.ep
3261     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_verify1.html.ep 1970-01-01 04:00:00.000000000 +0400
3262     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_verify1.html.ep 2021-01-19 21:06:59.000000000 +0400
3263     @@ -0,0 +1,37 @@
3264     +% layout 'default', title => "Sme server 2 - backup - verify";
3265     +% content_for 'module' => begin
3266     +
3267     +<div id="module">
3268     + % if ($config->{debug} == 1) {
3269     + <p>
3270     + %= dumper $c->current_route
3271     + %= dumper $bac_datas->{function}
3272     + <!-- dumper $bac_datas->{'files_list'} -->
3273     + </p>
3274     + % }
3275     +
3276     + % if ( stash 'error' ) {
3277     + <br><div class=sme-error>
3278     + %= $c->render_to_string(inline => stash 'error')
3279     + </div>
3280     + %}
3281     +
3282     + <h1><%= $title%></h1>
3283     +
3284     + <h2><%= l 'bac_VERIFY_WORKSTN_BACKUP_FILE' %></h2>
3285     +
3286     + <br>
3287     + %= $c->render_to_string(inline => $bac_datas->{files_list})
3288     + <br>
3289     +
3290     + %= form_for '/backupd' => (method => 'POST') => begin
3291     +
3292     + %= hidden_field 'Function' => $bac_datas->{'function'}
3293     +
3294     + <div class='center'>
3295     + %= submit_button $c->l('NEXT'), class => 'action'
3296     + </div>
3297     +
3298     + % end
3299     +</div>
3300     +% end
3301     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_verify.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_verify.html.ep
3302     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/back_workstn_verify.html.ep 2020-11-19 11:53:26.000000000 +0400
3303     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/back_workstn_verify.html.ep 2021-01-19 23:29:32.000000000 +0400
3304     @@ -1,5 +1,4 @@
3305     -% layout 'default', title => "Sme server 2 - backup";
3306     -
3307     +% layout 'default', title => "Sme server 2 - backup - verify";
3308     % content_for 'module' => begin
3309    
3310     <div id="module">
3311     @@ -18,20 +17,37 @@
3312    
3313     <h1><%= $title%></h1>
3314    
3315     - %= form_for '/backupd' => (method => 'POST') => begin
3316     -
3317     <h2>
3318     %=l 'bac_VERIFY_WORKSTN_BACKUP_FILE'
3319     </h2>
3320    
3321     - %= $c->render_to_string(inline => (l 'bac_CONFIGURATION_TO_BE_DONE'))
3322     + %= form_for '/backup' => (method => 'POST') => begin
3323    
3324     - <br>
3325     - %= hidden_field 'Function' => $bac_datas->{'function'}
3326     + % if ($bac_datas->{status} ne 'enabled') {
3327     + %= $c->render_to_string(inline => (l 'bac_CONFIGURATION_TO_BE_DONE'))
3328     + % } else {
3329     + %= $c->render_to_string(inline => (l 'bac_VERIFY_WORKSTN_BACKUP_DESC') . ' ' . $c->get_shared_folder_to_verify())
3330     + %}
3331     + <br><br><span class=label>
3332     + %=l 'bac_SELECT_BACKUP_FILE'
3333     + </span><span class=data>
3334     + %= select_field 'Backupset' => $c->get_Backupset_options(), class => 'input'
3335     + </span><br>
3336     +
3337     + <p><span class=label>
3338     + %=l 'bac_CHECK_TO_VERIFY_FULL_RESTORE'
3339     + </span><span class=data>
3340     + %= check_box 'Verifyall'
3341     + </span></p><br>
3342     +
3343     + %=l 'bac_CHECK_INTEGRITY_WARNING'
3344     +
3345     + <br><br>
3346     + %= hidden_field 'Function' => $bac_datas->{'function'} . '1'
3347     + <div class='center'>
3348     %= submit_button $c->l('bac_VERIFY'), class => 'action'
3349     + </div>
3350    
3351     % end
3352     -
3353     </div>
3354     -
3355     % end
3356     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep
3357     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2020-11-19 11:53:26.000000000 +0400
3358     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/layouts/default.html.ep 2021-01-24 20:45:38.000000000 +0400
3359     @@ -43,13 +43,16 @@
3360     % }
3361     </div>
3362     <div id="main" class="col-md-9">
3363     -
3364     % if (flash 'success') {
3365     <br><div class=success>
3366     %= $c->render_to_string(inline => flash 'success')
3367     </div>
3368     % }
3369     -
3370     + % if ( flash 'warning' ) {
3371     + <br><div class=sme-warning>
3372     + %= $c->render_to_string(inline => flash 'warning')
3373     + </div>
3374     + %}
3375     % if ( flash 'error' ) {
3376     <br><div class=sme-error>
3377     %= $c->render_to_string(inline => flash 'error')
3378     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/module.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/module.html.ep
3379     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/module.html.ep 2020-11-19 11:53:26.000000000 +0400
3380     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/module.html.ep 2021-01-27 00:38:22.000000000 +0400
3381     @@ -5,8 +5,8 @@
3382     <div id="module">
3383     <h3>
3384     %= $title
3385     - </h3>
3386     - %= $modul
3387     + </h3><br>
3388     + %= $c->render_to_string( inline => stash 'modul' )
3389     </div>
3390    
3391     %end
3392     \ Pas de fin de ligne à la fin du fichier
3393     diff -urN smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/reboot.html.ep smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/reboot.html.ep
3394     --- smeserver-manager-0.1.2.old/root/usr/share/smanager/themes/default/templates/reboot.html.ep 2020-11-19 11:53:26.000000000 +0400
3395     +++ smeserver-manager-0.1.2/root/usr/share/smanager/themes/default/templates/reboot.html.ep 2021-01-27 00:28:23.000000000 +0400
3396     @@ -17,8 +17,7 @@
3397    
3398     <% my $btn = l('PERFORM'); %>
3399    
3400     - % $modul = $c->render_to_string(inline => $c->l('rbo_DESCRIPTION'));
3401     - %= $modul
3402     + %= $c->render_to_string(inline => $c->l('rbo_DESCRIPTION'))
3403     <br>
3404    
3405     %= form_for 'reboot' => (method => 'POST') => begin

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