Quantcast
Channel: Why crontab scripts are not working? - Ask Ubuntu
Viewing all articles
Browse latest Browse all 48

Answer by Aaron Peart for Why crontab scripts are not working?

$
0
0

cron script is invoking a command with --verbose option

I had a cron script fail on me because I was in autopilot while typing the script and I included the --verbose option:

#!/bin/bashsome commandstar cvfz /my/archive/file.tar.gz /my/shared/directorycome more commands

The script ran fine when executing from shell, but failed when running from crontab because the verbose output goes to stdout when run from shell, but nowhere when run from crontab. Easy fix to remove the 'v':

#!/bin/bashsome commandstar cfz /my/archive/file.tar.gz /my/shared/directorysome more commands

Viewing all articles
Browse latest Browse all 48

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>