วันจันทร์ที่ 15 กรกฎาคม พ.ศ. 2556

Cron and Server Timezone

If you add task in cron by, e.g. crontab -e and it does not work at expected time,
1. check if cron service is running
    sudo service cron status
2. check if server timezone is what you expected by run date command
    date
    Mon Jul 15 17:47:40 ICT 2013

3. if server timezone is not what you expect, you can change by following these steps
     detail & screenshot here >> http://hacksforge.com/How-to-change-time-zone-in-Ubuntu-Linux.html 
    3.1 use command tzselect, then select geographic area > country > confirm
     tzselect
    3.2 add timzone to /etc/timezone as displayed in result of 3.1
     echo "Europe/London" | sudo tee /etc/timezone
     sudo dpkg-reconfigure --frontend noninteractive tzdata 
    3.3. restart cron service to refresh updated timezone
     sudo service cron restart

ไม่มีความคิดเห็น:

แสดงความคิดเห็น