cron on synology nas box not executing

Ryland

Platinum Member
Aug 9, 2001
2,810
13
81
I updated my /etc/crontab with the following and then have tried both rebooting my NAS box and restarting crond. For right now this is just a test to execute sendWOL (which runs fine on its own from the command prompt).


#minute hour mday month wday who command
* 12 17 7 * root ~admin/sendWOL


I think its setup, that every minute from 12:00pm -> 12:59pm on August 17th it will call ~admin/sendWOL as the root user. That is correct, right?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I updated my /etc/crontab with the following and then have tried both rebooting my NAS box and restarting crond. For right now this is just a test to execute sendWOL (which runs fine on its own from the command prompt).


#minute hour mday month wday who command
* 12 17 7 * root ~admin/sendWOL


I think its setup, that every minute from 12:00pm -> 12:59pm on August 17th it will call ~admin/sendWOL as the root user. That is correct, right?

I don't know if ~ works that way in a non-interactive shell and you shouldn't be relying on variable expansion in something like that anyway. You should be specifying the full path so that if the environment gets messed with it won't have any unintentional side effects.
 

Ryland

Platinum Member
Aug 9, 2001
2,810
13
81
I think your syntax is incorrect. Try $HOME/admin/sendWOL or /full/path/to/sendWOL.

The per script is in admin's home directory thus ~admin (which if I do "ls" for that in terminal it shows the file).

I ended up getting it to kick off by changing month from 7 to *. I need to figure out whats up with that since the docs say that month is 0 based.
 

Ryland

Platinum Member
Aug 9, 2001
2,810
13
81
It looks like the problem was the month. Cron for synology uses 1 based months, not 0 based.