493,14 → 493,15 |
|
|
######################################## |
sub add_to_backup{ |
my($file_name, $file_dir, $md5_checksum_stat, $checksum_stat); |
sub add_to_backup |
{ |
my($file_name, $file_dir, $md5_checksum_stat, $checksum_stat, $file_fullpath_esc); |
my($tmp, $stat_mode, $stat_uid, $stat_gid, $stat_size, $stat_mtime, $stat_time, $stat_flags); |
|
$file_name = $_; |
$file_fullpath = $File::Find::name; |
$file_dir = $File::Find::dir; |
my $file_fullpath_esc = $file_fullpath; |
$file_fullpath_esc = $file_fullpath; |
$file_fullpath_esc =~ s/\'/\'\\\'\'/g; |
|
# Создаем список директорий |
507,7 → 508,8 |
if ((-d $file_fullpath) && (! -l $file_fullpath)){ |
if (check_path($file_dir, $file_name) == 1){ |
if ($cfg_backup_style ne "hash"){ |
($tmp, $tmp, $stat_mode, $tmp, $stat_uid, $stat_gid, $tmp, $stat_size, $tmp, $stat_mtime, $stat_time, $tmp, $tmp, $tmp, $tmp, $tmp, $stat_flags, $tmp) = lstat($file_fullpath); |
($tmp, $tmp, $stat_mode, $tmp, $stat_uid, $stat_gid, $tmp, $stat_size, $tmp, $stat_mtime, |
$stat_time, $tmp, $tmp, $tmp, $tmp, $tmp, $stat_flags, $tmp) = lstat($file_fullpath); |
$stat_mode = sprintf ("%04o", $stat_mode & 07777); |
$file_fullpath_esc =~ s/^\/(.*)$/$1/; |
my ($sec,$min,$hour,$mday,$mon,$year) = localtime($stat_time); |
551,26 → 553,31 |
} |
} |
} |
} else { |
} |
else { |
if ($cfg_stopdir_prune == 1){ |
$File::Find::prune = 1; |
return; |
} |
} |
} |
# Работаем с файлами |
} elsif ((-f $file_fullpath) || (-l $file_fullpath)){ |
elsif((-f $file_fullpath) || (-l $file_fullpath)) { |
if (check_path($file_dir, $file_name) == 1){ |
($tmp, $tmp, $stat_mode, $tmp, $stat_uid, $stat_gid, $tmp, $stat_size, $tmp, $stat_mtime, $stat_time, $tmp, $tmp, $tmp, $tmp, $tmp, $stat_flags, $tmp) = lstat($file_fullpath); |
($tmp, $tmp, $stat_mode, $tmp, $stat_uid, $stat_gid, $tmp, $stat_size, $tmp, $stat_mtime, |
$stat_time, $tmp, $tmp, $tmp, $tmp, $tmp, $stat_flags, $tmp) = lstat($file_fullpath); |
unless($stat_flags & UF_NODUMP) { |
$checksum_stat= md5_base64("$stat_mtime/$stat_size/$stat_mode/$stat_uid/$stat_gid"); |
# $file_fullpath_md5 = md5_base64($file_fullpath); |
$file_fullpath_md5 = $file_fullpath; |
if ($cfg_time_limit != 0 && $cur_time - $cfg_time_limit > $stat_mtime){ |
print "Time limit: $cur_time - $cfg_time_limit > $stat_mtime, file $file_fullpath ignored.\n" if ($cfg_verbose == &VERB_ALL); |
print "Time limit: $cur_time - $cfg_time_limit > $stat_mtime, file $file_fullpath ignored.\n" |
if($cfg_verbose == &VERB_ALL); |
next; |
} |
if ($cfg_size_limit != 0 && $cfg_size_limit < $stat_size){ |
print "Size limit: $cfg_size_limit < $stat_size, file $file_fullpath ignored.\n" if ($cfg_verbose == &VERB_ALL); |
print "Size limit: $cfg_size_limit < $stat_size, file $file_fullpath ignored.\n" |
if($cfg_verbose == &VERB_ALL); |
next; |
} |
|