Hello. I have a script to find csv files and compress it into a zip file and save to another directory for archive. The script runs when I run it manually from the directory but it does not run when I put it to run as a cron job. What is wrong with my script? Please help.
#!/usr/bin/perl -w use strict; use warnings; use POSIX qw/strftime/; use IO::Compress::Zip qw(:all); my $now = strftime("%d%b%Y_%H00", localtime(time - 60*60)); my $dir = "/path/to/directory/"; my $arc = "/path/to/archive/"; zip [ glob("*-".$now.".csv") ] => $arc.$now.".zip" or die "Cannot create zip file: $ZipError" ; unlink glob($dir."*-".$now.".csv");
In reply to Zip script not running on cron by PerlMonger79
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |