in reply to Moving log files, create folder based on local time/date & zip them up based on local time & date.
As for naming the file, here is what I use:my $zip = Archive::Zip->new(); my $member = $zip->addFile( 'logfile.log' ); my $status = $zip->writeToFileNamed( 'dated_filename.zip' ); die "error somewhere" if $status != AZ_OK;
The fact that the files are located on another server shouldn't make much difference. Make sure you properly escape the backslashes...this should be enough to get you started.my $tempDate = getDate(); my $outfile = $tempDate . ".zip"; sub getDate { my $date; my($day, $mon, $year) = (localtime)[(3,4,5)]; $date = $mon . $day . $year; return $date; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Moving log files, create folder based on local time/date & zip them up based on local time & date.
by Anonymous Monk on Sep 09, 2002 at 19:13 UTC | |
by charnos (Friar) on Sep 09, 2002 at 19:32 UTC | |
by mjeaton (Hermit) on Sep 09, 2002 at 19:31 UTC |