cron

Crontab

Troubleshooting Crontab Problems Dump the Environement add this line to root’s crontab * * * * * env > ~/cronenv Load the Environement env - `cat /var/log/cronenv` /bin/sh Run your script ./script_with_env_problems.sh and check it’s output … sha256: 5aa695cbd618aad046f6b31e1c05dfc7d41db08fb39cbbbf95b6ac3a468d1f8a

Cron & Environment

Sometimes you run into problem because you’re not aware of the environment of cron. So, let’s dump and check the environment. Add Cronjob * * * * * env > /tmp/env.log Dump Content puffy200# cat /tmp/env.log LOGNAME=root HOME=/var/log PWD=/var/log PATH=/bin:/sbin:/usr/bin:/usr/sbin SHELL=/bin/sh USER=root sha256: 37f61e013134d5a2fd4dad64f1efdeb8ebde87e8c88fc86a1b389aa497b4cd72