Agnus Dei (jackal) wrote,
Agnus Dei
jackal

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


Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 0 comments