AR300M CronJob Failing

Hi.
I cannot get a cronjob to run in my AR300M. It appears Cron is enabled and started at boot, so no need to start it manually.

I have a test script in the root directory (script.sh) which runs fine if I execute manually (it simply sends an entry to the log “script working”). However, I cannot get it to work using cron. I went into Luci>System>Scheduled Tasks and added this:

*/1 * * * * /root/script

Also tried several variations “/1 script.sh", "/1 /script” etc. but no luck. Every minute I get something like this in the log:

USER root pid 16876 cmd /root/script

Also, after booting I get a time synch error (which might be part of the problem):
“cron.err crond[1579]: time disparity of 126 minutes detected”

Any ideas?

Thanks,
Glitch

 

 

OK, done further testing - it seems that “/root” is different from “/” (obvious now I think about it!).

Also, tried putting the script in another directory (/etc/crontabs) and managed to get the cronjob to run!

This was the final cronjob that worked:

*/1 * * * * /full/path/to/script/script.sh

So, in summary, it seems it was a combination of bad directory and bad scripting. I will report back if I find any further problems.

Glitch

 

 

thanks for sharing.