Hi I am trying to copy files from mapped drive (J:\) to a different machine.
The perl script is going to run on my machine to copy files from one place to another.
File transfer works when i copy files from mapped drive to my machine but when I tried to copy over to different machine throws me an error:
Please help me recrify
Here is my perl script as follows:
-
use File::Copy;
-
-
$dir="\\\\SOURCE\\PROD_LOGFILES\\LogFiles\\";
-
-
opendir(DIR, $dir) or die "can not open directory $dir: $! \n";
-
-
@files=readdir(DIR);
-
closedir DIR;
-
-
foreach $file (@files) {
-
if (-f "$dir$file") {
-
-
$moveloc="\\\\TARGET\\D\$\\FMP Project\\Production Log Files\\";
-
-
$old = "$dir$file";
-
$new = "$moveloc";
-
#copy($old, $new) or die "Copy Failed: $!"; #this line is working for my machine
-
move($old, $new) or die "Copy Failed: $!";
-
}
-
}
-