garcimo has asked for the wisdom of the Perl Monks concerning the following question:
now I want to use from a remote system using net:openssh so that it connects to the solaris with ssh finds the file and gives me the output..#!/usr/bin/perl use File::Find::Rule; use POSIX qw(strftime); my $today = time(); my $onehour = $today - (60*60); my @files = File::Find::Rule->file() ->name("*.0") ->mtime("<$onehour") ->in( "/mypath/" ); for my $file (@files) { print "$file\n"; }
is there a way to merge the two script in one central server without having to scp the scripts to all the hosts that the script needs to find files... I hope imy question is clearuse Net::OpenSSH; my $dir = '/mypath'; my $host = 'myhost'; my $ssh = Net::OpenSSH->new($host, user => adm_garcimo); $ssh->error and die "Couldn't establish SSH connection: ". $ssh->error;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: user net:openSSH and File::find::Rule together.
by salva (Canon) on Feb 15, 2018 at 15:27 UTC | |
by garcimo (Novice) on Feb 15, 2018 at 17:12 UTC | |
by salva (Canon) on Feb 15, 2018 at 17:16 UTC | |
by garcimo (Novice) on Feb 15, 2018 at 18:34 UTC | |
by salva (Canon) on Feb 15, 2018 at 18:39 UTC |