What's new

Crontab jobs disappeared.

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I combined logging and locking in the original version with instructions here:
Up and running.
 
why, you don't think daves previously posted script should work?
Sorry, I think we're talking at crossed purposes. I wasn't commenting on Dave's script, which I assume will work. I was responding to your statement "Hopefully everyone who invokes all these individual cronjobs realize...". I read that multiple times but couldn't quite see how that relates to the cru problem.
 
Sorry, I think we're talking at crossed purposes. I wasn't commenting on Dave's script, which I assume will work. I was responding to your statement "Hopefully everyone who invokes all these individual cronjobs realize...". I read that multiple times but couldn't quite see how that relates to the cru problem.
I am not saying it directly relates to the cru problem, more so jobs not having enough time to run because of blocking scripts such as init-start.

Code:
#!/bin/sh
#
# Add our scripts to cron job list.
#
cru a AGTxEM "15 3 * * * /jffs/AGT/scripts/regular-email"
cru a AGTxEU "3 4 * * * wl -i eth5 deauthenticate 8C:85:80:54:82:28"
cru a AGTxMQ "*/5 * * * * /jffs/AGT/scripts/send-cputemp-mqtt"
cru a AGTxBU "13 2 * * * /jffs/AGT/scripts/BackupToNAS.sh"

The more lines of cru we have, the more waiting init-start potentially does, especially if we are waiting on the nvram call that might have been bugging out. I just always have noted it is not a best practice to invoke directly from the main shell when you have more than one line of code.

eg.

mycron.sh
Code:
#!/bin/sh
#
# Add our scripts to cron job list.
#
cru a AGTxEM "15 3 * * * /jffs/AGT/scripts/regular-email"
cru a AGTxEU "3 4 * * * wl -i eth5 deauthenticate 8C:85:80:54:82:28"
cru a AGTxMQ "*/5 * * * * /jffs/AGT/scripts/send-cputemp-mqtt"
cru a AGTxBU "13 2 * * * /jffs/AGT/scripts/BackupToNAS.sh"

then invoke it from init-start like this:-

Code:
#!/bin/sh
#
#
sh /jffs/scripts/mycron.sh &

instead of this being the entire contents of init-start

Code:
#!/bin/sh
#
# Add our scripts to cron job list.
#
cru a AGTxEM "15 3 * * * /jffs/AGT/scripts/regular-email"
cru a AGTxEU "3 4 * * * wl -i eth5 deauthenticate 8C:85:80:54:82:28"
cru a AGTxMQ "*/5 * * * * /jffs/AGT/scripts/send-cputemp-mqtt"
cru a AGTxBU "13 2 * * * /jffs/AGT/scripts/BackupToNAS.sh"

But I digress, I believe @dave14305 and @ColinTaylor have this:- @alan6854321 stick with @dave14305 script. The flock method is the best way to go with this. You can take my additional advice as a grain of salt among giants. Peace.
 
Last edited:
I have just come back from the pub, and I have lost the plot!
 
from the main shell when you have more than one line of code.
This doesn’t seem to work the same on ash as it does on bash.
So, it is one that will work with busy box ash, but it is possible that it might not on the router being tested on. I havent looked that closely. It can be adjusted back to shift if that's the case. "${*:2}" is just a positional arguement meaning to expand all values except the 1st one.
 
I have just come back from the pub, and I have lost the plot!
The cru replacement in post #79 has been updated with locking. Follow the instructions there:
 
The cru replacement in post #79 has been updated with locking. Follow the instructions there:
It is logging a LOT now and spamming the main log - could it get its own log file in /opt/var/log ?
 
It is logging a LOT now and spamming the main log - could it get its own log file in /opt/var/log ?
It shouldn't be spamming the log. You'll get a flurry of activity when you reboot your router but it should settle down.
If it is spamming check the log for what is calling cru.
 
Bit of a disaster here - my AX86S blew it's jffs partition.
Lots of this stuff in my syslog

Code:
08-Mar 09:35:27 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:27 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:27 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!
08-Mar 09:35:27 AX dnsmasq-script[2824]: json_object_from_file: error opening file /jffs/nmp_vc_json.js: No such file or directory
08-Mar 09:35:27 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:27 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:27 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!
08-Mar 09:35:27 AX dnsmasq-script[2824]: json_object_to_file: error opening file /jffs/nmp_vc_json.js: No space left on device
08-Mar 09:35:28 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:28 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:28 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!

Don't think it had anything to do with the 'cru' experiments - I saw a couple of messages a while ago, now it boots after a factory reset but keeps crashing.

Had to dig out my old AC86U to get connectivity back but now no AiMesh so the whole house isn't covered.

Was thinking of buying a AX88U anyway - is that a reasonable replacement?
 
@alan6854321 As you said, the problem is nothing to do with this thread. There are many reports of this error. Try backing up your settings and JFFS partition (Administration - Restore/Save/Upload Setting). Then do a hard factory reset followed by restoring your settings first and then the JFFS. Reboot and see if the problem is still there.
 
Bit of a disaster here - my AX86S blew it's jffs partition.
Lots of this stuff in my syslog

Code:
08-Mar 09:35:27 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:27 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:27 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!
08-Mar 09:35:27 AX dnsmasq-script[2824]: json_object_from_file: error opening file /jffs/nmp_vc_json.js: No such file or directory
08-Mar 09:35:27 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:27 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:27 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!
08-Mar 09:35:27 AX dnsmasq-script[2824]: json_object_to_file: error opening file /jffs/nmp_vc_json.js: No space left on device
08-Mar 09:35:28 AX kernel: jffs2: Argh. No free space left for GC. nr_erasing_blocks is 0. nr_free_blocks is 0. (erasableempty: yes, erasingempty: yes, erasependingempty: yes)
08-Mar 09:35:28 AX kernel: jffs2: jffs2_reserve_space_gc of 196 bytes for garbage_collect_dnode failed: -28
08-Mar 09:35:28 AX kernel: jffs2: Error garbage collecting node at 0022f9ac!

Don't think it had anything to do with the 'cru' experiments - I saw a couple of messages a while ago, now it boots after a factory reset but keeps crashing.

Had to dig out my old AC86U to get connectivity back but now no AiMesh so the whole house isn't covered.

Was thinking of buying a AX88U anyway - is that a reasonable replacement?
Agreed. It happened to me a couple of months ago, but luckily I run BACKUPMON and was able to wind back about 10 hours. This jffs2 error just happens.
AX88U is a good router, but if I needed to replace a router now I'd go with a pro version.
 
As you said, the problem is nothing to do with this thread. There are many reports of this error. Try backing up your settings and JFFS partition (Administration - Restore/Save/Upload Setting). Then do a hard factory reset followed by restoring your settings first and then the JFFS. Reboot and see if the problem is still there

Tried the 'hard reset' and I think it may have worked.
Luckily I had a recent backup as trying to save jffs just crashed it instantly.
Think you might have saved me the price of a new router
Cheers!
 
Tried the 'hard reset' and I think it may have worked.
Luckily I had a recent backup as trying to save jffs just crashed it instantly.
Think you might have saved me the price of a new router
Cheers!
If that's the case run through the "Restore" option a couple of times from the Administration menu, ticking the option box both times. Any bad cells in the storage will be marked as such and removed from use.
 
Now let's get back to the fascinating crontab jobs disappearing topic! :)

1709907275218.png
 
Last edited:
I’d be interested in anyone’s cru logs after a reboot when multiple commands are getting executed. I’d like to see if the locking messages look close they're doing the job.
 
I’d be interested in anyone’s cru logs after a reboot when multiple commands are getting executed. I’d like to see if the locking messages look close they're doing the job.
Having done many reboots recently, it looks like the init-start script gets run before syslog starts. So the cru commands don't appear in the log after a boot.

(Oh - and my AX86S died again - looks like it's new router time)
 
I’d be interested in anyone’s cru logs after a reboot when multiple commands are getting executed. I’d like to see if the locking messages look close they're doing the job.
I ran it from last night till now. Did "grep -a cru messages > cru1.txt". There was an auto-restart at 4:05am today. See the log.
 

Attachments

  • cru1.txt
    220.3 KB · Views: 17
I’d be interested in anyone’s cru logs after a reboot when multiple commands are getting executed. I’d like to see if the locking messages look close they're doing the job.
In my case the count is already 5 before logging starts.
 

Attachments

  • cronj.txt
    16.5 KB · Views: 16

Similar threads

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top