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; }
In reply to Re: Moving log files, create folder based on local time/date & zip them up based on local time & date.
by mjeaton
in thread Moving log files, create folder based on local time/date & zip them up based on local time & date.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |