Lines 38-43
Link Here
|
38 |
my $opt_all; |
38 |
my $opt_all; |
39 |
my $opt_exclude; |
39 |
my $opt_exclude; |
40 |
my $opt_exclude_path; |
40 |
my $opt_exclude_path; |
|
|
41 |
my $opt_rsync_exclude; |
41 |
my $opt_debug = 1; |
42 |
my $opt_debug = 1; |
42 |
my $opt_dumpdir; |
43 |
my $opt_dumpdir; |
43 |
my $opt_compress = 0; |
44 |
my $opt_compress = 0; |
Lines 59-64
Link Here
|
59 |
my @script_ext = qw (start stop mount umount); |
60 |
my @script_ext = qw (start stop mount umount); |
60 |
|
61 |
|
61 |
my @findexcl; |
62 |
my @findexcl; |
|
|
63 |
my @rsyncexcl; |
62 |
|
64 |
|
63 |
sub find_add_exclude { |
65 |
sub find_add_exclude { |
64 |
my ($excltype, $value) = @_; |
66 |
my ($excltype, $value) = @_; |
Lines 300-305
Link Here
|
300 |
print STDERR "usage: $0 OPTIONS [--all | VPSID]\n\n"; |
302 |
print STDERR "usage: $0 OPTIONS [--all | VPSID]\n\n"; |
301 |
print STDERR "\t--exclude VPSID\t\texclude VPSID (assumes --all)\n"; |
303 |
print STDERR "\t--exclude VPSID\t\texclude VPSID (assumes --all)\n"; |
302 |
print STDERR "\t--exclude-path REGEX\texclude certain files/directories\n"; |
304 |
print STDERR "\t--exclude-path REGEX\texclude certain files/directories\n"; |
|
|
305 |
print STDERR "\t--rsync-exclude PATTERN\texclude certain files/directories on rsync stage.\n"; |
303 |
print STDERR "\t--compress\t\tcompress dump file (gzip)\n"; |
306 |
print STDERR "\t--compress\t\tcompress dump file (gzip)\n"; |
304 |
print STDERR "\t--dumpdir DIR\t\tstore resulting files in DIR\n"; |
307 |
print STDERR "\t--dumpdir DIR\t\tstore resulting files in DIR\n"; |
305 |
print STDERR "\t--xdelta\t\tcreate differential backup using xdelta\n"; |
308 |
print STDERR "\t--xdelta\t\tcreate differential backup using xdelta\n"; |
Lines 347-352
Link Here
|
347 |
if (!GetOptions ('all' => \$opt_all, |
350 |
if (!GetOptions ('all' => \$opt_all, |
348 |
'exclude=s@' => \$opt_exclude, |
351 |
'exclude=s@' => \$opt_exclude, |
349 |
'exclude-path=s@' => \$opt_exclude_path, |
352 |
'exclude-path=s@' => \$opt_exclude_path, |
|
|
353 |
'rsync-exclude=s@' => \$opt_rsync_exclude, |
350 |
'compress' => \$opt_compress, |
354 |
'compress' => \$opt_compress, |
351 |
'restore=s' => \$opt_restore, |
355 |
'restore=s' => \$opt_restore, |
352 |
'mailto=s@' => \$opt_mailto, |
356 |
'mailto=s@' => \$opt_mailto, |
Lines 395-402
Link Here
|
395 |
find_add_exclude ('-regex', $path); |
399 |
find_add_exclude ('-regex', $path); |
396 |
} |
400 |
} |
397 |
} |
401 |
} |
398 |
|
|
|
399 |
|
402 |
|
|
|
403 |
if ($opt_rsync_exclude) { |
404 |
foreach my $path (@$opt_rsync_exclude) { |
405 |
push @rsyncexcl, "--exclude", "'$path'"; |
406 |
} |
407 |
} |
400 |
|
408 |
|
401 |
sub check_bin { |
409 |
sub check_bin { |
402 |
my ($bin, $msg) = @_; |
410 |
my ($bin, $msg) = @_; |
Lines 698-704
Link Here
|
698 |
|
706 |
|
699 |
mkdir $tmpdir || die "unable to create tmpdir"; |
707 |
mkdir $tmpdir || die "unable to create tmpdir"; |
700 |
|
708 |
|
701 |
my $synccmd = "$rsync -aH --delete $dir $tmpdir"; |
709 |
my $exclude_args = join (' ', @rsyncexcl); |
|
|
710 |
my $synccmd = "$rsync -aH --delete $exclude_args $dir $tmpdir"; |
702 |
debugmsg ('info', "starting first sync $dir to $tmpdir", \*LOG); |
711 |
debugmsg ('info', "starting first sync $dir to $tmpdir", \*LOG); |
703 |
run_command (\*LOG, $synccmd); |
712 |
run_command (\*LOG, $synccmd); |
704 |
|
713 |
|
Lines 838-843
Link Here
|
838 |
can use this option more than once to specify |
847 |
can use this option more than once to specify |
839 |
multiple exclude paths |
848 |
multiple exclude paths |
840 |
|
849 |
|
|
|
850 |
--rsync-exclude PATTERN exclude certain files/directories on rsync stage. |
851 |
See man rsync for PATTERN syntax. |
852 |
|
841 |
--compress compress dump file (gzip) |
853 |
--compress compress dump file (gzip) |
842 |
|
854 |
|
843 |
--dumpdir DIR store resulting files in DIR |
855 |
--dumpdir DIR store resulting files in DIR |