My cron is a hour late

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
harisund
DD-WRT Novice


Joined: 13 Jun 2010
Posts: 19

PostPosted: Fri Feb 16, 2018 19:01    Post subject: My cron is a hour late Reply with quote
Code:

root@buffalo:/jffs# cat /tmp/cron.d/cronjobs
* 6 * * * root /jffs/bin/reboot_now.sh > /jffs/log_reboot.log


Code:

root@buffalo:/jffs# cat /jffs/log_reboot.log
Starting poweroff at ... Fri Feb 16 06:59:00 UTC 2018
Rebooting


Any idea why a cronjob that has a "run at 6" instruction actually runs at 06:59, every day?
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6437
Location: UK, London, just across the river..

PostPosted: Sat Feb 17, 2018 6:18    Post subject: Reply with quote
as we don't know your router model and build you are currently on... no we cant help you .... Embarassed
_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
harisund
DD-WRT Novice


Joined: 13 Jun 2010
Posts: 19

PostPosted: Mon Feb 19, 2018 3:02    Post subject: Reply with quote
Sorry, I didn't realize that made a difference

Code:

Router Name buffalo
Router Model WZR-600DHP
Firmware Version DD-WRT v24SP2-MULTI (11/04/12) std - build 20180


Does that help? Is there a known cron bug in that model?

I read in the cron wiki that in some cases cron just stops working and one has to do stopservice cron ; startservice cron or something like that to get it to work. But this doesn't seem like that case.
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1857
Location: Hung Hom, Hong Kong

PostPosted: Mon Feb 19, 2018 15:43    Post subject: Reply with quote
harisund wrote:
Sorry, I didn't realize that made a difference

Code:

Router Name buffalo
Router Model WZR-600DHP
Firmware Version DD-WRT v24SP2-MULTI (11/04/12) std - build 20180

20180 is a very old build. Should you try something newer? BUT... but... recent builds' ntpclient becomes buggy! Smile

Would an error in time caused by ntpclient affect cron? Maybe.... it could happen.

If you don't wanna try a newer build, you might want to add a hourly cron job to set the time periodically and see if it's the clock skew that caused your problems.

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
harisund
DD-WRT Novice


Joined: 13 Jun 2010
Posts: 19

PostPosted: Tue Feb 20, 2018 6:30    Post subject: Reply with quote
Quote:
To make matters worse, we don't even know what that script is using to tell time. I would assume the date function, but at the moment, that's only an assumption. It could be getting the time from the internet for all we

I literally just have $(date) > log file

Quote:
AFAIK, cron is using local time, but your job is reporting UTC time. What your job is reporting is only incorrect if you happen NOT to be operating in the UTC time zone. Is that the case?


Can you help me find out if that is the case? Here are my details.

First, on the "Setup" -> "Basic Setup" page, I have the following details -

Code:

Time Settings
NTP Client: Enable
Time Zone: UTC-06:00
Summer Time (DST): 2nd Sun Mar - first Sun Nov
Server IP/Name: ntp.lsu.edu


I live in central time zone (UTC -6)

When I ssh into the router, I see this -

Code:

root@buffalo:~# date
Tue Feb 20 00:29:16 UTC 2018


It says "UTC", but actually that is the time in Central (my actual time). That means something's wrong somewhere right? Should it not say either

(A) Tue Feb 20 06:29 UTC
(B) Tue Feb 20 00:00

The fact that it says my local time but then reports it at UTC seems like a bug to me. Am I seeing this correctly?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum