---------------------------------------------------------- usage: posix /c [] error creating \\NTSERVER\TempLogs\020910145659! at testWL.pl line 28. ---------------------------------------------------------- This script will move log files in a folder that will be created based on the time stamped of the server.... ######################################################### my $filedir = "\\\\NTSERVER\\Templogs"; my $IWlogs = "\\\\NTSERVER\\Templogs\\*.log*"; ######################################################### # get timestamp to name a file yymmddhhmiss.txt ######################################################### ($sec,$min,$hour,$mday,$mon,$year) = localtime(time); $mon = (1,2,3,4,5,6,7,8,9,10,11,12)[$mon]; if($mon < 10){$mon = "0" . $mon;} # add a leading zero to one-digit months if($mday < 10){$mday = "0" . $mday;} # add a leading zero to one-digit days if($hour < 10){$hour = "0" . $hour;} # add a leading zero to one-digit hours if($min < 10){$min = "0" . $min;} # add a leading zero to one-digit minutes if($sec < 10){$sec = "0" . $sec;} # add a leading zero to one-digit seconds $dirname = substr($year,1,3) . $mon . $mday . $hour . $min . $sec; $createDir = $filedir . "\\" . $dirname; if(!-e $createDir) { @args = ( "mkdir", $createDir); system(@args) == 0 or die "error creating $createDir!"; } ########################################################## #move log files to new directory ########################################################## @args = ( "move" , $IWlogs , $createDir ) ; system( @args ) == 0 or die "error moving $IWlogs!";