CRON Script not executing

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

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:
[email protected]:/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.
 

eibgrad

Very Senior Member
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.
 

memphis2k

Occasional Visitor
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.
 

eibgrad

Very Senior Member
Are you sure you marked init-start as executable?

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

ColinTaylor

Part of the Furniture
The router's firmware doesn't have /bin/bash so it will crash straight away.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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