I can't seem to find support for the CRON_TZ settings for crontab. How would I configure ansible to run a cron job for a specific timezone?
This is what I want my crontab file to look like. This cron config is currently running on a CentOS 7 box.
/etc/crontab:
# Default Timezone
30 9 * * * bobr /home/bobr/crontest.sh LOCAL "`date -R`"
CRON_TZ=Canada/Eastern
30 11 * * * bobr /home/bobr/crontest.sh Eastern "`date -R`"
45 11 * * * bobr/home/bobr/crontest.sh Eastern "`date -R`"
CRON_TZ=Canada/Pacific
30 8 * * * bobr/home/bobr/crontest.sh Pacific "`date -R`"
44 8 * * * bobr/home/bobr/crontest.sh Pacific "`date -R`"
For reference crontest.sh just sends an email with the 2 parameters:
#!/bin/bash
echo "this is the cron test. $1 $2" | mail -s "Cron Test" bobr@example.com