Hi ,
Iam trying to copy files from Mapped Drive U to another Drive D: on DSame Server.
U drive has sub folders . Target location Drive: D:\x\y\z\
My script is looping through one file (list of files i need to copy from U: to D:\x\y\z).
Files inside list has complete path for each files.
for example . Suppose my file is 1.txt it has 3 files listed
1.pdf
/a/b/2.pdf
/a/3.pdf
..
l am looping through this file and copy from U drive if that file exist .
my script is runing fine if i run it from DOS ny executing command perl <script name>.pl
But when iam calling same script from scheduler(autosys), Its not recognizing U drive .
User is same .
my code is :
#!/usr/bin/perl
use File::Copy;
use strict;
open(MYDATA, "D:/1.txt") or die("Error: cannot open file 'gdmp_pdf_file_list.out'\n
");
my $line;
while( $line = <MYDATA> ){
chomp($line);
print "$line\n";
if ( -e "U:$line" )
{
copy ("U:$line","D:/x/y/z;
}
else
{
print "File Doesnot Exist\n";
}
}
close MYDATA;
system("erase \\\\nldn1062pww\\compmonit
or\\GDMP\\
GSS\\Scrip
t\\gdmp_pd
f_file_lis
t.out");
when iam running through Scheduler its printing File doesnot exist.
Connection is active.
Start Free Trial