Crontab

  • Debugging Cron with env
    env -i <your command to run> # first try empty env
    * * * * * /usr/bin/env | sort > /tmp/cron_env_vars # capture env
    env -i $(cat /tmp/cron_env_vars | xargs) <your command to run>
    env -i $(cat /tmp/cron_env_vars | xargs) printenv # example

  • Tools
    journalctl --since "1 hour ago" -t CRON