App-SimpleBackuper
view release on metacpan or search on metacpan
lib/App/SimpleBackuper/Restore.pm view on Meta::CPAN
map { $state->{db}->{uids_gids}->unpack($_) }
@{ $state->{db}->{uids_gids} }
;
my($db_group) = map {$_->{name}}
grep {$_->{id} == $version->{gid}}
map { $state->{db}->{uids_gids}->unpack($_) }
@{ $state->{db}->{uids_gids} }
;
if(($fs_user ne $db_user or $fs_group ne $db_group) and ! S_ISLNK $version->{mode}) {
print "\tin backup it owned by $db_user:$db_group but on FS - by $fs_user:$fs_group.\n" if $options->{verbose};
chown scalar(getpwnam $db_user), scalar getgrnam($db_group), $fs_path if $options->{write};
}
if(S_ISDIR $version->{mode}) {
foreach my $subfile (sort {$a->{name} cmp $b->{name}} map {@$_} $state->{db}->{files}->find_all({parent_id => $file->{id}})) {
_proc_file($options, $state, $subfile, $backup_path.'/'.$subfile->{name}, $fs_path.'/'.$subfile->{name});
}
}
}
local/lib/perl5/Net/SFTP/Foreign.pm view on Meta::CPAN
map { $arg_types[$_] => $_[$_] } 0..$#arg_types );
$sftp->_check_status_ok($id,
SFTP_ERR_REMOTE_SETSTAT_FAILED,
"Couldn't setstat remote file ($name)");
};
no strict 'refs';
*$name = $sub;
}
_gen_setstat_shortcut(truncate => 'file', SSH2_FILEXFER_ATTR_SIZE, 'int64');
_gen_setstat_shortcut(chown => 'any' , SSH2_FILEXFER_ATTR_UIDGID, 'int32', 'int32');
_gen_setstat_shortcut(chmod => 'any' , SSH2_FILEXFER_ATTR_PERMISSIONS, 'int32');
_gen_setstat_shortcut(utime => 'any' , SSH2_FILEXFER_ATTR_ACMODTIME, 'int32', 'int32');
sub _close {
@_ == 2 or croak 'Usage: $sftp->close($fh, $attrs)';
my $sftp = shift;
my $id = $sftp->_queue_rid_request(SSH2_FXP_CLOSE, @_);
defined $id or return undef;
local/lib/perl5/Net/SFTP/Foreign.pm view on Meta::CPAN
remote file handles.
Returns true on success and undef on failure.
=item $sftp-E<gt>fsetstat($handle, $attrs)
this method is deprecated.
=item $sftp-E<gt>truncate($path_or_fh, $size)
=item $sftp-E<gt>chown($path_or_fh, $uid, $gid)
=item $sftp-E<gt>chmod($path_or_fh, $perm)
=item $sftp-E<gt>utime($path_or_fh, $atime, $mtime)
Shortcuts around C<setstat> method.
=item $sftp-E<gt>remove($path)
Sends a C<SSH_FXP_REMOVE> command to remove the remote file
( run in 1.207 second using v1.01-cache-2.11-cpan-71847e10f99 )