I have had luck using PowerNap (it is packaged for ubuntu-sever, but the source is there so you should be able to compile it on anything) to suspend backup machines when they aren't doing anything. However, this won't wake them up automatically. There is also a PowerWake program bundled with the PowerNap source tarball (packaged as
powerwake in Ubuntu) that provides a bit of abstraction to the Wake-On-Lan process (makes it easy to send WOL just with the hostname, for instance), but it is still not automatic.
Edit. Another Option:
I don't know much about it because I've never used it, but some cards are capable of waking on any unicast message. You can see if your card has the capability using ethtool
# ethtool eth0
Substitute eth0 for your network device. Then look at the output for the line starting with "Supports Wake-on:". If "u" is listed on that line, then you can do the following at boot(ie, in an init script or something similar):
ethtool -s eth0 wol u
Combined with PowerNap or anything else that puts the machine to sleep under some conditions, this should provide what you are looking for.