| « ESXi USB Stick How To from Linux | VMware Update Manager Stalls While Scanning » |
I have an old machine stockpiled full of old medium capacity hard drives that I use as my weekly backup/dump nfs destination for some virtual machine images. Thing about this particular machine is that it doesn't do anything else the rest of the week except spew heat and eat electricity.
I decided to try to use Wake On LAN to help get the machine started up when it was needed. Not knowing how to get WOL configured within Linux I set out on a Google search to help me figure out what my options were. Surprisingly, the first hit came back with what I needed. The link to the Ubuntu How To can be found here:
HOW TO: power on remotely with WakeOnLan (WOL)
The readers digest version is:
Get ethtool on the Debian backup to disk (b2d) server:
apt-get install ethtool
Edit your /etc/rc.local file on the b2d server and a add this before the exit 0
ethtool -s eth0 wol g
This configures eth0 to except the magic packet to wake up when the machine is shutdown.
If you're using a linux box somewhere on your network, you can schedule a cron job to wake up the b2d server before the backups are schedule to run. As the link states, this is simple as well.
Get the wakeonlan utility on the remote server:
apt-get install wakeonlan
Write a script that includes the following statement, and schedule a cron job to execute it 10 minutes or so before your backups are schedule to run:
wakeonlan -i B2DServersIP B2DServersMACAddr
Finally, in my situation, the backup jobs are executed from the B2D server so I included a shutdown statement at the end of the backup script (the one from the reference link works fine):
shutdown -h -P now
This makes sure the server is turned off after the backups run.
That's it. Now the B2D server runs 164 less hours a week.