Avatar of abraha

asked on 

how to check file exists on remote server

I am working on a Perl script that will logon to remote server and check if files exist on the hard driver.
I am new to Perl scripting, but so fare I got the script to check the files on the local Server now I need to find a way to check the files on the all of the servers.
#!/usr/bin/perl   -w 
use strict;
print "Content-type:text/html\n\n";
#list of files we need to check for
my ($Each_Files, @Array_Files,@Server_List );
@Array_Files = qw(
@Server_List = qw(host1 host2 host3);
foreach $Each_Files ( @Array_Files)         {
if (-e $Each_Files)
     print "Successfull! \n";
       else             {
     print "Not Successfull! \n";

Open in new window


Avatar of undefined
Last Comment

8/22/2022 - Mon