Advertisement

04.10.2008 at 05:39PM PDT, ID: 23313831
[x]
Attachment Details

Perl script to Copy Files from Mapped Drive to another drive on same Server.

Asked by sunilbains in Perl Programming Language

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\\compmonitor\\GDMP\\GSS\\Script\\gdmp_pdf_file_list.out");


when iam running through Scheduler its printing File doesnot exist.
Connection is active.

Start Free Trial
Related Solutions: Perl script to Unmap drive
 
Loading Advertisement...
 
[+][-]04.10.2008 at 06:09PM PDT, ID: 21330745

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.10.2008 at 07:20PM PDT, ID: 21331009

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 03:53AM PDT, ID: 21332918

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 05:53AM PDT, ID: 21333717

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 06:45AM PDT, ID: 21334173

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 07:17AM PDT, ID: 21334483

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 07:27AM PDT, ID: 21334559

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 07:48AM PDT, ID: 21334759

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 07:50AM PDT, ID: 21334788

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 08:12AM PDT, ID: 21334994

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 08:13AM PDT, ID: 21335012

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 08:16AM PDT, ID: 21335052

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 08:28AM PDT, ID: 21335180

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 08:34AM PDT, ID: 21335238

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 10:42AM PDT, ID: 21336422

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.11.2008 at 10:48AM PDT, ID: 21336492

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628