Author
Message
tkmds DD-WRT User Joined: 04 Sep 2011 Posts: 161 Location: SA
Posted: Sun Apr 17, 2022 17:05 Post subject: Cron running but not executing anything in UI.
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
------------------------
Back to top
Sponsor
egc DD-WRT Guru Joined: 18 Mar 2014 Posts: 12917 Location: Netherlands
Back to top
tkmds DD-WRT User Joined: 04 Sep 2011 Posts: 161 Location: SA
Posted: Sun Apr 17, 2022 19:15 Post subject:
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
------------------------
Back to top
egc DD-WRT Guru Joined: 18 Mar 2014 Posts: 12917 Location: Netherlands
Posted: Sun Apr 17, 2022 19:19 Post subject:
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
Back to top
tkmds DD-WRT User Joined: 04 Sep 2011 Posts: 161 Location: SA
Posted: Sun Apr 17, 2022 20:18 Post subject:
(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
------------------------
Back to top
yoyoma2 DD-WRT User Joined: 24 Sep 2016 Posts: 373
Posted: Mon Apr 18, 2022 4:38 Post subject:
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.
Back to top
tkmds DD-WRT User Joined: 04 Sep 2011 Posts: 161 Location: SA
Posted: Mon Apr 18, 2022 4:51 Post subject:
I can confirm no restart is needed. _________________ Cheers, TK
------------------------
Back to top
kernel-panic69 DD-WRT Guru Joined: 08 May 2018 Posts: 14247 Location: Texas, USA
Back to top