I'm trying to move log files in a remote directory (share) to a folder created in that share, but when I run the perl script, it only creates a the time stamped folder and does not move the log files in the share directory into the new one. What am I doing wrong????
Thanks for you help!
use POSIX; use File::Copy; my $WLpath = '\\\\10.1.1.5\\Weblogiclogs\\' . strftime( '%y%m%d%H%M', +localtime); ######################################## # Creating directory based on time stamp ######################################## { mkdir $WLpath or die "Couln't create $WLpath because $!($^E)\n"; } ############## sub Move_Logs ############## { my $logs = "\\\\192.168.2.5\\Weblogiclogs\\*.log"; my $target = $WLpath; move("$logs", "$target") or die ("move from $target to $logs was unsuc +essful because - $!($^E)\n"); }
Edit by dws for <code> tags
In reply to moving logs files on a remote share. by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |