507,17 → 507,31 |
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); |
$stat_time = sprintf ("%4.4d%2.2d%2.2d%2.2d%2.2d.%2.2d", |
$year+1900,$mon+1,$mday,$hour,$min,$sec); |
print DIRS "mkdir -p '$file_fullpath_esc'\n"; |
print DIRS "chmod $stat_mode '$file_fullpath_esc'\n"; |
print DIRS "chown $stat_uid:$stat_gid '$file_fullpath_esc'\n"; |
print DIRS "touch -t $stat_time '$file_fullpath_esc'\n"; |
if($stat_flags) { |
print DIRS "chflags " |
. ($stat_flags & UF_NODUMP ? "nodump," : "") |
. ($stat_flags & UF_IMMUTABLE ? "uchg," : "") |
. ($stat_flags & UF_APPEND ? "uappnd," : "") |
. ($stat_flags & UF_OPAQUE ? "opaque," : "") |
. ($stat_flags & UF_NOUNLINK ? "uunlnk," : "") |
. ($stat_flags & SF_ARCHIVED ? "arch," : "") |
. ($stat_flags & SF_IMMUTABLE ? "schg," : "") |
. ($stat_flags & SF_APPEND ? "sappnd," : "") |
. ($stat_flags & SF_NOUNLINK ? "sunlnk," : "") |
. " '$file_fullpath_esc'\n"; |
} |
|
unless($stat_flags & UF_NODUMP) { |
$stat_mode = sprintf ("%04o", $stat_mode & 07777); |
$file_fullpath_esc =~ s/^\/(.*)$/$1/; |
my ($sec,$min,$hour,$mday,$mon,$year) = localtime($stat_time); |
$stat_time = sprintf ("%4.4d%2.2d%2.2d%2.2d%2.2d.%2.2d", |
$year+1900,$mon+1,$mday,$hour,$min,$sec); |
print DIRS "mkdir -p '$file_fullpath_esc'\n"; |
print DIRS "chmod $stat_mode '$file_fullpath_esc'\n"; |
print DIRS "chown $stat_uid:$stat_gid '$file_fullpath_esc'\n"; |
print DIRS "touch -t $stat_time '$file_fullpath_esc'\n"; |
$cur_backup_size += int(length($file_fullpath)/100.0 + 1)*512; |
if ($cfg_maximum_archive_size > 0 && $cur_backup_size + 10240 >= $cfg_maximum_archive_size){ |
my $old_val = $cur_backup_size - $stat_size - int(length($file_fullpath)/100.0 + 1)*512; |