I have a questions to all the perl monks out there. I wrote a little script to create a folder based on local time and move all *.log files in that shared directory (my $filedir")into the newly created folder. When I run the script, it just creates the folder on my local workstation (where the script is located - D:\Perl\Bin), and not on the intended remote location. It also looks like it "deleted" all the logs files located in the remote directory rather than moving it into the new folder. Please help....I've been trying to figure this out for hours but with no avail...
thanks,
(The script creates the folder correctly based on local time stamped, but only on my workstation rather the remote share (\\10.1.1.5\weblogiclogs), also the "move" section in the script looks like it's moving all logs in the remote share somewhare else rather the the intended folder that was created by the script - the time stamped folder.)
********************* use POSIX; ********************************************** * Specify remote share the script will affect *********************************************** my $filedir = "\\\\10.1.1.5\\Weblogiclogs"; *************************************************** * Specify any logs in the weblogiclogs directory **************************************************** my $IWlogs = "\\\\10.1.1.5\\Weblogiclogs\\*.log*"; # Get Local Time and Create folder based on local time stamped my $createdir = strftime( '%y%d%e%H%M%S', localtime); # Create folder based on local time obtained above if(!-e $createDir) { mkdir $createdir or die "Couln't create $createdir because $! +($^E)\n"; } # move logs files to new created directory named after # the local time. @args = ( "move" , $IWlogs , $createDir ) ; system( @args ) == 0 or die "error moving $IWlogs reason $!($^E)"; #
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |