in reply to Re: Re: Re: Re: Re: Re: Please help - problem with script on Win2K
in thread Please help - problem with script on Win2K
The following program should solve your immediate problem. I have tested it as far as I can, but if there are permission problems with your shares etc. you'll need to get someone who supports your systems to solve that.
If you have further problems with Perl, and from your code its likely you will, could I
If your serious about learning Perl (rather than just solving your immediate problem), then I highly recommend that you consider going here and becoming a member. It's free and you will find it a lot easier to keep track of your posts and their replies if they don't get mixed up with all the other Anonymous Monk's posts.
#! perl use warnings; use strict; use POSIX; use File::DosGlob 'glob'; use File::Copy; my $createdir = '\\\\10.1.1.5\\Weblogiclogs\\' . strftime( '%y%m%d%H%S +', localtime); my $logs = '\\\\10.1.1.5\\Weblogiclogs\\*.log'; if( ! -e $createdir ) { mkdir $createdir or die "Couln't create $createdir because $!($^E) +\n"; } my @logs = glob( $logs ); for my $file (@logs) { print "Moving file:$file to $createdir\n"; move( $file, $createdir ) or warn "Couldn't move file:$file becaus +e $! ($^E)\n"; }
|
|---|