What's new
  • 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!

Cron/Cru jobs disappear overnight

Ok, so I just rebooted for the first time in a month, and the service start goes a bit weird. Any ideas?

Commands being called are:
Code:
cru a DisableWPS 0 0 * * * /jffs/scripts/DisableWPS.sh
cru a FreshJRQoS 0 * * * * /jffs/scripts/FreshJRQoS.sh
cru a FTPBandwidthCalc */1 * * * * /jffs/scripts/FTPBandwidthCalc.sh
cru a CheckVPNServer1 */15 * * * * service start_vpnserver1
cru a CheckVPNClient1 */60 * * * * service start_vpnclient1


cru l ends up looking like:

Code:
admin@RT-AC87U:/tmp/home/root# cru l
0 0 asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs                                                                              lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys s                                                                             ysroot tmp usr var www /jffs/scripts/DisableWPS.sh #DisableWPS#
0 asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs l                                                                             ib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sys                                                                             root tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www /jffs/scripts/FreshJRQoS.s                                                                             h #FreshJRQoS#
proc/1 asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home j                                                                             ffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sy                                                                             s sysroot tmp usr var www asus_jffs bin cifs1 cifs2 dev etc home jffs lib media mmc mnt opt proc rom root sbin sys sysroot tmp usr var www /jffs/scripts/FTPBand                                                                             widthCalc.sh #FTPBandwidthCalc#
*/15 * * * * service start_vpnserver1 #CheckVPNServer1#
*/60 * * * * service start_vpnclient1 #CheckVPNClient1#

Edit running cru d * and then the cru a gives correct results, so I'm assuming it's running too soon in services-start and tripping over.
 
Last edited:
Taken a different approach to get something working.
Code:
services-start:

crontab /jffs/scripts/CronTab.txt

CronTab.txt:

0 0 * * * /jffs/scripts/DisableWPS.sh #DisableWPS#
0 * * * * /jffs/scripts/FreshJRQoS.sh #FreshJRQoS#
*/1 * * * * /jffs/scripts/FTPBandwidthCalc.sh #FTPBandwidthCalc#
*/15 * * * * service start_vpnserver1 #CheckVPNServer1#
*/60 * * * * service start_vpnclient1 #CheckVPNClient1#
 
cru l ends up looking like:
Looks like the *'s are being expanded (glob) by the shell. You should really put double quotes around the cron parameters.

Code:
# cru

Cron Utility
add:    cru a <unique id> <"min hour day month week command">
delete: cru d <unique id>
list:   cru l
 
Looks like the *'s are being expanded (glob) by the shell. You should really put double quotes around the cron parameters.

Code:
# cru

Cron Utility
add:    cru a <unique id> <"min hour day month week command">
delete: cru d <unique id>
list:   cru l
I'll give that a go, thanks.
 
I'll give that a go, thanks.
With double quotes, that would be:
Code:
cru a DisableWPS "0 0 * * * /jffs/scripts/DisableWPS.sh"
 

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!
Back
Top