Cron job not running

JGrana

Very Senior Member
I have a fairly simple script called switchwan.sh in /jffs/scripts.
It starts with #!/bin/sh and is executable.

It runs a speedtest and if the Primary WAN is less than 10 Mbit if calls wan-failover.sh to switch.
There are some logger_t messages and I keep a running log file with the speedtest results.

Works fine from the command line.

I added a cron job like this to have it run every 30 minutes:

cru a "SwitchWan" "*/30 * * * * /jffs/scripts/switchwan.sh"

It shows up when I do a cru l

But I don't believe it ever starts. I get all the log info in /tmp/syslog.log and the log file gets updated every time I manually run it.

I see the correct line in /var/spool/cron/crontabs/admin and I have also done a "service restart_crond"

Any other ideas on how to troubleshoot cron issues?
 

Yota

Very Senior Member
What is the output of cru l?

try adding it like this:
Code:
cru a switchwan "*/30 * * * * sh /jffs/scripts/switchwan.sh"
 

JGrana

Very Senior Member
Thanks, I think I found the culprit.

I was using "logger_t" instead of "logger -t".

Running happily!
 

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