in reply to Re: file copy from windows system
in thread file copy from windows system
Thanks to everyone who has replied to this thread. Hi BrowserUK, I have used the method what you have suggested.It worked for smaller f +iles. But when the file size started increasing, the perl script star +ted hanging. In the below code snippet the shyam.txt and shyam1.txt files are of sm +aller size and it gets copied.But when the zip file is being copied, +the script hangs. The zip file is of size around 40-60MB.In the below example out of 4 f +iles only first 3 files are copied that is shyam.txt,shyam1.txt,Logs2 +011-09-19_2321.zip and the 4th zip file is not copied but script got +completed. Can you suggest if something needs to be corrected? If this works then + I need to try copying large log files of size in GBs. Also I would like to know if any perl packages are required to be inst +alled in order to achieve this. thanks in advance
my $remote_system_ip = "10.10.2.2"; my $user_name = "Administrator"; my $password = "d*diablo123"; my $source_dir = "C:\\shyam\\dir1"; my $target_file1 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\shyam.txt"; my $target_file2 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\shyam1.txt"; my $target_file3 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\Logs2011-09- +19_2321.zip"; my $target_file4 = "\\\\$remote_system_ip\\c\$\\shyam_IC\\Logs2011-09- +19_215.zip"; `net use \\\\$remote_system_ip\\c\$ $password \/user:$user_name`; `copy \/Y $target_file1 $source_dir`; print("1"); `copy \/Y $target_file2 $source_dir`; print("2"); `copy \/Y $target_file3 $source_dir`; print("3"); `copy \/Y $target_file4 $source_dir`; print("4"); `net use \\\\$remote_system_ip\\c\$ \/delete`;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: file copy from windows system
by BrowserUk (Patriarch) on Jul 23, 2012 at 11:56 UTC | |
by rkshyam (Acolyte) on Jul 25, 2012 at 10:31 UTC |