Agnus Dei (jackal) wrote,
Agnus Dei

How to get crons to work with EDT vs EST on a Ubuntu

Since Ubuntu does not recognize the CRON_TZ varaible in cron, I wrote this little test to make it so this cron will always run at the same time everyday at 7:01am.

#This crons runs at 7:01am every day regardless of EDT or EST.
1 11 * * * root test `TZ=America/New_York date +"\%Z"` = "EDT" && my_script_here
1 12 * * * root test `TZ=America/New_York date +"\%Z"` = "EST" && my_script_here

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened