in reply to File test on remote machine and mkpath
if it's a directory you want to test add -d switch to the ls command.my $g_cmd="ssh Machinename ls <completefilepath>"; `$g_cmd`; if($?) { print "Error doesnot exist"; } else { $g_cmd="scp local_file remotehost:targetdirectory/remote_file"; `$g_cmd`; }
|
|---|