in reply to How to execute stat command in remote server
though, you would need the development version of Net::SFTP::Foreign, available from CPAN but not installed by default by the CPAN module!.use Net::SFTP::Foreign; my $sftp = Net::SFTP::Foreign->new(host => $hostname) or die "unable to connect to $hostname"; my $t24h_ago = time - 24*3600; my @lf = $sftp->find('.', wanted => sub { my (undef, $entry) = @_; $entry->{a}->mtime > $t24h_ago; }); for my $lf (@logfiles) { my $name = $lf->{filename}; my $attr = $lf->{a}; printf("file: %s, mode: %o, uid: %d, gid: %d, size: %d, atime: %d, m +time: %d\n", $name, $a->mode, $a->uid, $a->gid, $a->size. $a->atime, $a->m +time); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to execute stat command in remote server
by dpath2o (Acolyte) on Nov 26, 2013 at 05:13 UTC | |
by salva (Canon) on Nov 26, 2013 at 10:20 UTC | |
by Anonymous Monk on Nov 26, 2013 at 07:36 UTC | |
by dpath2o (Acolyte) on Nov 26, 2013 at 22:20 UTC |