Cron running but not executing anything in UI.

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
tkmds
DD-WRT User


Joined: 04 Sep 2011
Posts: 161
Location: SA

PostPosted: Sun Apr 17, 2022 17:05    Post subject: Cron running but not executing anything in UI. Reply with quote
Hey Folks,

Cron is running:

Code:
# ps|grep -Ei cron
 4713 root     cron
 4849 root     grep -Ei cron


But there is nothing showing up in a test file that should bet a text with the latest time:

Code:
# Reboot the router everyday near 4AM. 
0 4 * * * startservice run_rc_shutdown; /sbin/reboot

# Test call
*/1 * * * * echo "Cron Test $(date)" > /jffs/cron-test-file.txt


Tried a few suggestions here:

https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=711636

Checked logs:

Apr 17 12:45:44 DD-WRT-KHUFU user.info : [cron] : daemon successfully stopped
Apr 17 12:45:52 DD-WRT-KHUFU user.info : [cron] : daemon successfully started
Apr 17 12:49:01 DD-WRT-KHUFU user.info : [cron] : daemon successfully stopped
Apr 17 12:49:10 DD-WRT-KHUFU user.info : [cron] : daemon successfully started
Apr 17 12:49:10 DD-WRT-KHUFU cron.info cron[3944]: (CRON) STARTUP (fork ok)

But nothing get's this to work. Any hints?

_________________
Cheers, TK
------------------------
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Sun Apr 17, 2022 17:47    Post subject: Reply with quote
What build are you running?

There have been problems with cron in the past

Furthermore to run you need the right syntax:
https://wiki.dd-wrt.com/wiki/index.php/CRON

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
tkmds
DD-WRT User


Joined: 04 Sep 2011
Posts: 161
Location: SA

PostPosted: Sun Apr 17, 2022 19:15    Post subject: Reply with quote
Latest I could get, though this feature hasn't worked since r43502, the oldest of the F/W I have on any of my Asus routers. The current one has:

Firmware: DD-WRT v3.0-r48646 std (04/12/22)

Thinking the entries I have are fine. Had this before as well but nada:

* * * * * echo "Cron Test $(date)" > /jffs/cron-test-file.txt

Which isn't different then any Linux host it appears.

_________________
Cheers, TK
------------------------
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12885
Location: Netherlands

PostPosted: Sun Apr 17, 2022 19:19    Post subject: Reply with quote
Not sure if this applies but from the wiki:
Quote:
It is important that you include "root" before the command, otherwise the command will not run as specified.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
tkmds
DD-WRT User


Joined: 04 Sep 2011
Posts: 161
Location: SA

PostPosted: Sun Apr 17, 2022 20:18    Post subject: Reply with quote
(facepalm)

Yeppers, that was it! Looks like I hurriedly scanned the page for the crontab commands without properly reading the entire page.

Thanks egc!

_________________
Cheers, TK
------------------------
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Mon Apr 18, 2022 4:38    Post subject: Reply with quote
egc wrote:
Furthermore to run you need the right syntax:
https://wiki.dd-wrt.com/wiki/index.php/CRON

Whoever has access to editing that wiki page should correct the Restarting Crond section which falsely claims: "you will need to restart cron in order for your changes to take effect". If you try the example from that page:

Code:
echo '* * * * * root /bin/date > /tmp/test.txt' > /tmp/cron.d/date

and wait for the next minute change (up to one minute), the job will start running. The same principle applies when deleting the /tmp/cron.d/date file to stop the new cron job from running. The wiki was correct before my cron fix in 2019 because the cron database in memory would get corrupted on any incremental additions/deletions. Only a full cron database reload would work back then.
tkmds
DD-WRT User


Joined: 04 Sep 2011
Posts: 161
Location: SA

PostPosted: Mon Apr 18, 2022 4:51    Post subject: Reply with quote
I can confirm no restart is needed.
_________________
Cheers, TK
------------------------
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14221
Location: Texas, USA

PostPosted: Mon Apr 18, 2022 17:31    Post subject: Reply with quote
I'll look through for your fix, @yoyoma2 and make the appropriate edits. Does anyone have a timeline on the commands required?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
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