////////////////////////////////////////////////////////////////////////////////////// // CRONTAB TASK STOPS PREMATURELY, THOUGH SCRIPT RUNS FINE // // Bryan Smith, Friday May 9 2008 ////////////////////////////////////////////////////////////////////////////////////// I wrote a shell script to help us detect any issues on our network, the details of which are not important. I can run the script fine from the shell, but when I would set it as a cron job, it would stop prematurely. It would always complete the same amount of work, and without any error messages, nothing else would happen. (I know this because I created a separate log within the shell script.) Supposedly, the output of a cronjob is stored in a user's mailbox. Not sure if a limitation is set, but after I redirected the output, the script would complete. So instead of: ------------------------------------------------------------------------------ 5 0 * * * /home/tranche/check-special-project-migration.sh ------------------------------------------------------------------------------ I used: ------------------------------------------------------------------------------ 5 0 * * * /home/tranche/check-special-project-migration.sh > /dev/null 2>&1 ------------------------------------------------------------------------------ I don't need the output, anyhow, as the shell script keeps a separate log of failures and successes. However, if you do need it, just redirect to a log for you to review: ------------------------------------------------------------------------------ 5 0 * * * /home/tranche/check-special-project-migration.sh >> /home/tranche/check-special-project-migration.log 2>&1 ------------------------------------------------------------------------------