Morning,
I am trying to put a file from 1 server directory to another server directory. I keep getting the below error message I am not sure what i am missing. I apologize for the dumbness still trying to learn Perl.
Cannot open Local file /usr/local/cyclone/data/ZZAAFES/binaryout/test.txt: No such file or directory
===================================================
#!/usr/bin/perl
use File::Copy;
use File::Basename;
#DEFINE VARIABLES
my $now = localtime;
open
$dir = "///Hqdata01/sdmidata/VIALINK/IMFT/test.txt";
print "DIR name IS: $dir\n";
$path = "/usr/local/cyclone/data/ZZAAFES/binaryout/";
print "Path filename is: $path\n";
$file = basename($dir);
#INITIATES FTP CONNECTION TO CYCLONE AND WRITES VIALINK FILE FROM Hqdata01
ftpsub();
sub ftpsub {
use NET::FTP;
my $ftp;
$ftp = Net::FTP -> new("cyclone.aafes.com", Debug=> 1) || ((print REPORT "$now->ERROR:FTP HQDATA01 TO CYCLONE FAILED\n"), return(1));
$ftp->login("loginid","pwd") || ((print REPORT "$now->FTP REPORT failed\n"), return(1));
$ftp->cwd($path) || ((print REPORT "$now-> $path - Change path failed\n"), return(1));
print "Path is: $path\n";
print "Put file: $file\n";
#$ftp->put ($dir . $file) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
#$ftp->put ($dir . $path) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
$ftp->put ($path . $file) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
$ftp->close();
print Report "$now->FTP TO CYCLONE IMF COMPLETED\n";
return (0);
};
close REPORT;
exit;
I am trying to put a file from 1 server directory to another server directory. I keep getting the below error message I am not sure what i am missing. I apologize for the dumbness still trying to learn Perl.
Cannot open Local file /usr/local/cyclone/data/ZZAAFES/binaryout/test.txt: No such file or directory
===================================================
#!/usr/bin/perl
use File::Copy;
use File::Basename;
#DEFINE VARIABLES
my $now = localtime;
open
$dir = "///Hqdata01/sdmidata/VIALINK/IMFT/test.txt";
print "DIR name IS: $dir\n";
$path = "/usr/local/cyclone/data/ZZAAFES/binaryout/";
print "Path filename is: $path\n";
$file = basename($dir);
#INITIATES FTP CONNECTION TO CYCLONE AND WRITES VIALINK FILE FROM Hqdata01
ftpsub();
sub ftpsub {
use NET::FTP;
my $ftp;
$ftp = Net::FTP -> new("cyclone.aafes.com", Debug=> 1) || ((print REPORT "$now->ERROR:FTP HQDATA01 TO CYCLONE FAILED\n"), return(1));
$ftp->login("loginid","pwd") || ((print REPORT "$now->FTP REPORT failed\n"), return(1));
$ftp->cwd($path) || ((print REPORT "$now-> $path - Change path failed\n"), return(1));
print "Path is: $path\n";
print "Put file: $file\n";
#$ftp->put ($dir . $file) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
#$ftp->put ($dir . $path) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
$ftp->put ($path . $file) || ((print REPORT "$NOW-> $filename - Putting file failed\n"), return(1));
$ftp->close();
print Report "$now->FTP TO CYCLONE IMF COMPLETED\n";
return (0);
};
close REPORT;
exit;