What's new

CRON Script not executing

  • 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!

memphis2k

Occasional Visitor
Did a little searching but found nothing that worked.

ASUS-Merlin 384.19 running on a RT-AC68U.

Script works manually, but I can't get CRON to run it after a reboot.

ping_google.sh

Code:
#!/bin/bash
#ping google and send a REST command back to ISY.  Then ISY sends to Pushover
#Using curl because it doesn't create 0 files in directory
    ping -q -c 1 -w 5 google.com > /dev/null

if [ $? -eq 0 ]; then
    echo "House Online - Google"
    curl --silent --output /dev/null http://**********/rest/vars/set/2/19/0
    logger -t PX_DETECT "House Online - Google";
else
    echo "House Offline - Google"
    curl --silent --output /dev/null http://****************/rest/vars/set/2/19/1
    logger -t PX_DETECT "House Offline - Google";
fi

init-start

Code:
#!/bin/sh
cru a pinggo "* * * * * /jffs/scripts/ping_google.sh"

Running cru l

Code:
admin@RT-AC1900P-33D8:/tmp/home/root# cru l
* * * * * /jffs/scripts/ping_google.sh #pinggo#

All scripts are 755

Nothing in syslog after a reboot. I have JFFS scripts turned on Admin / System. Running VLANs & Wifi Proximity scripts with no issues, however, not as CRON.
 
FWIW, ran it here exactly as you described. Even the same router (RT-AC68U) and firmware (384.19). Works perfectly. I see it in the syslog every minute. I don't see any obvious mistakes.
 
FWIW, ran it here exactly as you described. Even the same router (RT-AC68U) and firmware (384.19). Works perfectly. I see it in the syslog every minute. I don't see any obvious mistakes.

Thanks. At least I know it works for someone. I have another AC68 I'll this on, have my scripts configured on two of these AP's. I can always see it in the syslog running it manually, never by CRON.
 
Are you sure you marked init-start as executable?

Do you have "Enable JFFS custom scripts and configs" enabled in System->Administration?
 
Last edited:

Attachments

  • initstart.png
    initstart.png
    11.7 KB · Views: 174

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