1 |
stephdl |
1.1 |
diff -Nur e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/console/perform_backup.pm e-smith-backup-2.6.0.new/root/usr/share/perl5/vendor_perl/esmith/console/perform_backup.pm |
2 |
|
|
--- e-smith-backup-2.6.0.old/root/usr/share/perl5/vendor_perl/esmith/console/perform_backup.pm 2016-02-05 00:08:22.000000000 +0100 |
3 |
|
|
+++ e-smith-backup-2.6.0.new/root/usr/share/perl5/vendor_perl/esmith/console/perform_backup.pm 2016-07-26 11:05:45.178100028 +0200 |
4 |
|
|
@@ -42,6 +42,7 @@ |
5 |
|
|
return sub { |
6 |
|
|
my $fh = shift; |
7 |
|
|
my @backup_list = esmith::Backup->restore_list; |
8 |
|
|
+ my @backup_excludes = esmith::Backup->excludes; |
9 |
|
|
|
10 |
|
|
unless (open(DU, "-|")) |
11 |
|
|
{ |
12 |
|
|
@@ -100,8 +101,12 @@ |
13 |
|
|
close GZIP; |
14 |
|
|
close $fh; |
15 |
|
|
chdir "/"; |
16 |
|
|
- exec qw(tar cf -), grep { -e $_ } @backup_list; |
17 |
|
|
- } |
18 |
|
|
+ #Create the archive |
19 |
|
|
+ my @directories = grep { -e $_ } @backup_list; |
20 |
|
|
+ my @exclude = map ("--exclude=$_",@backup_excludes); |
21 |
|
|
+ exec ("/bin/tar cf - @directories @exclude"); |
22 |
|
|
+ } |
23 |
|
|
+ |
24 |
|
|
waitpid($tar, 0); |
25 |
|
|
warn "status from tar was $?\n" if $?; |
26 |
|
|
unless (close PV) |
27 |
|
|
@@ -127,6 +132,7 @@ |
28 |
|
|
{ |
29 |
|
|
my ($self, $console, $db) = @_; |
30 |
|
|
my @backup_list = esmith::Backup->restore_list; |
31 |
|
|
+ my @backup_excludes = esmith::Backup->excludes; |
32 |
|
|
|
33 |
|
|
$ENV{PATH} = "/bin:/usr/bin"; |
34 |
|
|
$ENV{HOME} = "/root"; |
35 |
|
|
@@ -140,6 +146,19 @@ |
36 |
|
|
gettext("Do you wish to create backup on removable media?"), |
37 |
|
|
); |
38 |
|
|
return unless $rc == 0; |
39 |
|
|
+ |
40 |
|
|
+ if (@backup_excludes) { |
41 |
|
|
+ my $backupexclude = join ("\n/", sort @backup_excludes); |
42 |
|
|
+ ($rc, $choice) = $console->yesno_page |
43 |
|
|
+ ( |
44 |
|
|
+ title => gettext("Some parts are excluded of your backup"), |
45 |
|
|
+ left => gettext("Next"), |
46 |
|
|
+ right => gettext("Cancel"), |
47 |
|
|
+ text => '/' . $backupexclude, |
48 |
|
|
+ ); |
49 |
|
|
+ return unless $rc == 0; |
50 |
|
|
+ } |
51 |
|
|
+ |
52 |
|
|
INITIATE_BACKUP: |
53 |
|
|
($rc, $choice) = $console->yesno_page |
54 |
|
|
( |