my $out = $ssh->capture({stdin_data => <<'EOS'}, '/usr/bin/perl'); # Your remote script goes here: use File::Find::Rule; use POSIX qw(strftime); ... EOS
Probably this method is going to be slower than the others as running a find operation over SFTP does lots of network roundtrips, but on the other hand you don't depend on having perl there, in some known place or programming for an antediluvian Perl version.my $sftp = $ssh->sftp; my $now = time; my @files = $sftp->find("/mypath", wanted => sub { my $e = $_[1]; $e->{filename} =~ /\.0$/ or return; $e->{a}->mtime + 3600 >= $now or return; 1 });
Update: The capture method call was wrong. Corrected!
In reply to Re: user net:openSSH and File::find::Rule together.
by salva
in thread user net:openSSH and File::find::Rule together.
by garcimo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |