Cron jobs and my theory on how I got it to work

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
Brianwuz
DD-WRT User


Joined: 10 Feb 2010
Posts: 104

PostPosted: Sat Aug 01, 2020 17:49    Post subject: Cron jobs and my theory on how I got it to work Reply with quote
Router/Version: Netgear R8000
Mode: Gateway/AP
Firmware: DD-WRT v3.0-r40270M kongac (07/11/19)
Kernel: Linux 4.4.185 #670 SMP Thu Jul 11 02:19:39 CEST 2019 armv7l
Reset: Yes
Issues/Errors: Crond.

This is my cron jobs:
*/5 * * * * root /jffs/openvpncl/cktun0
0 0 * * * root /jffs/openvpncl/restcrond

I could not get cron to work. During troubleshooting, I added the following line:
* * * * * root echo "Cron ran "$(date) > /tmp/ct
Cron was working after adding that line. I removed the line and it stopped working again. After giving it some thought, I realized what I had done. Apparently when I put my test line in, I did not push enter at the end of the line. I removed my test line and did not push enter after the second line and it is working again. So it appears that you can not have any blank lines in cron jobs which means do not push enter after your last job. I tried it both ways and if there is a blank line then the cron jobs do not run. I would appreciate if someone else would test this theory and report back the results.

Thanks,
Brian
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Mon Aug 03, 2020 1:23    Post subject: Reply with quote
I was a kong user when I fixed dd-wrt's cron issues. Kong left dd-wrt and never produced a build that includes the fix. Switch to more recent BS builds to get the fixed cron or search for "cron bug workaround" on the forums.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware 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