CRON + WOL => Only solution that works to me !!!

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
marlboro35
DD-WRT Novice


Joined: 01 May 2009
Posts: 4

PostPosted: Fri May 01, 2009 22:33    Post subject: CRON + WOL => Only solution that works to me !!! Reply with quote
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:


00 23 * * 1 root /usr/sbin/wol -p 7 -i 192.168.1.255 xx:xx:xx:xx:xx:xx
00 23 * * 3 root /usr/sbin/wol -p 7 -i 192.168.1.255 xx:xx:xx:xx:xx:xx


This set of commands in my case, are waking my PC up at 11PM on Mondays and Wednesdays (to download my favorite TV series Very Happy)

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 !!


Hope it helps !!!


Alberto Smile



WRT54-Cron-WOL.JPG
 Description:
 Filesize:  21.14 KB
 Viewed:  14880 Time(s)

WRT54-Cron-WOL.JPG


Sponsor
BobsLanOnTheWan
DD-WRT Novice


Joined: 21 Jan 2008
Posts: 25

PostPosted: Fri Jul 29, 2011 23:47    Post subject: Reply with quote
Hrmm... Odd. Isn't working for me.
abishur
DD-WRT Novice


Joined: 17 Nov 2010
Posts: 7

PostPosted: Wed Sep 21, 2011 2:57    Post subject: Reply with quote
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.
shake
DD-WRT Novice


Joined: 27 Jun 2012
Posts: 1

PostPosted: Wed Jun 27, 2012 15:23    Post subject: Re: CRON + WOL => Only solution that works to me !!! Reply with quote
LOL I like how you masked your internal mac address as if it matters at all.

I appreciate the good info though.
James2k
DD-WRT Guru


Joined: 23 Oct 2011
Posts: 524

PostPosted: Wed Jun 27, 2012 18:50    Post subject: Reply with quote
Great method, been using it for months to power on two HP Microservers on a daily basis.
_________________
James

Main router:

Netgear R7000 overclocked to 1.2GHz - DD-WRT v3.0-r31980M kongac (05/11/17)
IPv6 (HE.net), OpenVPN (with PBR), Entware-ng, DNSCrypt, YAMon3, dnsmasq + ipset6

Easy ipset support for the R7000

VPN speed: Download: 77.96 Mbps Upload: 5.00 Mbps (AES-128-CBC HMAC-SHA1)

Yes you can get 50 Mbps+ with OpenVPN on a R7000 if you configure it properly!

Previous routers:

ASUS RT-N66U - The Dark Knight
WNR2000v3 - Bought on the cheap for someone else, neutered crap
WNR3500Lv1 - First venture into the DD-WRT world
djk44883
DD-WRT Novice


Joined: 04 Jan 2009
Posts: 3

PostPosted: Mon Apr 20, 2015 21:35    Post subject: Reply with quote
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

Code:
00 06 * * 6,7 root /usr/sbin/wol -p 7 -i 192.168.1.255  00:00:00:00:00:00


which didn't work. When I had a separate entry for each day - problem solved.

Code:
00 06 * * 6 root /usr/sbin/wol -p 7 -i 192.168.1.255  00:00:00:00:00:00
00 06 * * 7 root /usr/sbin/wol -p 7 -i 192.168.1.255  00:00:00:00:00:00
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum