Problem: System is running in UTC time zone and I would like to set user cron entries in local time (Australia/Melbourne). It is annoying modifying your cron jobs every 6 months due to daylight savings changes.
Resolution: Install fcron
and get time zone aware cronjobs
Download the Dev version of fcron
from http://fcron.free.fr/
1 2 3 4 5 6 7 8 9 | wget http: //fcron . free .fr /archives/fcron-3 .3.1.src. tar .gz tar -xzvf fcron-3.3.1.src. tar .gz cd fcron-3.3.1 . /configure --sysconfdir= /etc # put the config files in /etc make # by default it will install binaries to /usr/local sudo make install # answer the questions basically say yes to adding fcron user / groups and install systemd service |
As a user
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | fcrontab -l 2022-02-23 02:03:03 INFO listing myusers's fcrontab &timezone(Australia /Melbourne ) 17 19 * * * echo ` date ` >> /tmp/date2 # check /tmp/date2 after 5:17PM cat /tmp/date2 # output Tue Feb 8 19:17:00 AEDT 2022 Wed Feb 9 19:17:00 AEDT 2022 Thu Feb 10 19:17:00 AEDT 2022 Fri Feb 11 19:17:00 AEDT 2022 Sat Feb 12 19:17:00 AEDT 2022 Sun Feb 13 19:17:00 AEDT 2022 Mon Feb 14 19:17:00 AEDT 2022 Tue Feb 15 19:17:00 AEDT 2022 Wed Feb 16 19:17:00 AEDT 2022 Thu Feb 17 19:17:00 AEDT 2022 Fri Feb 18 19:17:00 AEDT 2022 Sat Feb 19 19:17:00 AEDT 2022 Sun Feb 20 19:17:00 AEDT 2022 Mon Feb 21 19:17:00 AEDT 2022 Tue Feb 22 19:17:00 AEDT 2022 |
0 Comments