Posted: Fri May 01, 2009 22:33 Post subject: CRON + WOL => Only solution that works to me !!!
Hi,
I recently had to spend a couple of hours trying to figure out how to schedule a cron job
to wake my PC up at some specified days and hours along the week.
After trying EVERY SINGLE HINT/TIP/SUGGESTION in this forum and the Wiki, and searched
(with no luck) for a syntax description of the involved commands (wol and cron) I ended up
with the very known (but not less painfull) "try and error" approach.
Finally, I discovered the ONLY WORKING COMBINATION (at least for me) for a cron job in the GUI
Web section, as follows:
This set of commands in my case, are waking my PC up at 11PM on Mondays and Wednesdays (to download my favorite TV series )
Just guessing, I´d say that the general format should be:
mm hh dd MM wd root /usr/sbin/wol -p <port> -i <IP Address> <MAC Address>
Where:
- mm: Minutes (0-59)
- hh: Hour (0-23)
- dd: Day of month (1-31)
- MM: Month (1-12)
- wd: Weekday (0: Sunday, 1: Monday and so on)
You can use an star "*" on any field to schedule repetitive jobs.
Some caveats:
- If you forget the -p ==> It doesn´t work
- If you forget the -i ==> It doesn´t work
- If you forget the "root" part ==> It doesn´t work
- If you forget the "/usr/sbin/" ==> It doesn´t work
I tried also other WORKING options:
- You can change -i by -h (I don`t know what it means, couldn´t find any documentation)
- You can invert the order for IP and the MAC addresses (???)
- You can place the "-p 7" anywhere in the command line
This syntax IS WORKING and tested used a WOL Debugging Monitor (look for it at depicus.com) with a WRT54GL router running DD-WRT V24-PreSP2 Std-nokaid Build 11296.
If anyone has better ideas or explanations are welcome !! Please share !!
I just wanted to chime in saying that this solution worked for me as well. Two things though.
As the WOL tutorial says, you have to have WOL enabled in BIOS as well as in the hardware properties of your NIC in Windows (or whatever OS)
The second thing is, if I forced off my PC rather than letting it shut down normal or turned it off before it was done booting, it did not work for me at all.
I *had* to shut down the computer from windows in order for the WOL features to work properly.
Another tip to the very old and extremely helpful thread. Seems you can only specify one day at a time per command. I tried having and event on Saturday and Sunday with