Now I use the home workstation jobs more ... / 2010-11-02

2010-11-02 Now I use the home workstation jobs more ... 8 years ago
Now I use the home workstation jobs more for audio work I also want that data in the backup cycle on a regular basis. But backups happen when I sleep and normally the system is off when not in use.

Solution: kick the workstation awake using wake-on-lan. That is easy when I know the ethernet address for the active network card and set the system up right (which does mean the power use is non-zero).

18 5 * * Mon,Fri /usr/sbin/etherwake -i eth0.1 jobs
Nicely in sync with the backup scheme.

But that does mean the system is running which is not needed after the backup is done. But sometimes I leave it running overnight for some computation task(s). Solution, a script on the workstation which runs when the backup should be done at 07:10, somewhat less than 2 hours after the wake:

# check if I'm awaken for backup, in that case: shutdown when there is no
# amanda process

if [ "`awk ' $1 < 7200 { print "ja" } ' < /proc/uptime`" = "ja" ]; then
        if [ "`pidof amandad`" = "" ]; then
                /sbin/shutdown -h now
Only when the number of seconds uptime is less than 7200 (2 hours) and there is no amanda daemon left, the system will shutdown. Scheduled backups working, no needless running of the system and when it has been started with other reasons it won't shut down.
The detour via awk is because the -lt option of test doesn't like fractional numbers.

Tags: , ,

, reachable as PGP encrypted e-mail preferred.

PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers pgp key statistics for 0x5BA9368BE6F334E4 Koos van den Hout
Other webprojects: Camp Wireless, wireless Internet access at campsites, The Virtual Bookcase, book reviews
This page generated in 0.004422 seconds.