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

2010-11-02 Now I use the home workstation jobs more ...
Attention: this item is more than 5 years old, links can be broken and information can have been updated.
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:
#!/bin/sh

# 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
        fi
fi
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: , ,

IPv6 check

Running test...
, reachable as koos+website@idefix.net. PGP encrypted e-mail preferred. PGP key 5BA9 368B E6F3 34E4 local copy PGP key 5BA9 368B E6F3 34E4 via keyservers

RSS
Meningen zijn die van mezelf, wat ik schrijf is beschermd door auteursrecht. Sommige publicaties bevatten een expliciete vermelding dat ze ongevraagd gedeeld mogen worden.
My opinions are my own, what I write is protected by copyrights. Some publications contain an explicit license statement which allows sharing without asking permission.
Other webprojects: Camp Wireless, wireless Internet access at campsites
This page generated by $Id: newsitem.cgi,v 1.62 2023/09/19 14:49:50 koos Exp $ in 0.009367 seconds.