in reply to Problems using gzip in a Perl program
Do you mean $tar_filename? Or do you mean $gzip_filename? The script went to the trouble of setting the latter up.$status = system sprintf("/usr/local/bin/gzip %s/%s", $backupDir, $tar_filename);
Regardless, you may be running into a very common "problem" with chron jobs. They run with a partial environment, without the benefit of .login, .cshrc, or whatever. If any code upstream of your fragment is trying to load environment variable, you need to check very carefully to make sure those variables are truly present when running from chron.
One stylistic issue: $status = system("/usr/local/bin/gzip", "$backupDir/$gzip_filename"); is a preferable way to invoke system(). To learn why, read the description of system(), paying attention to the difference between calling it with a single and with multiple arguments.
|
|---|