Networker

Re: [Networker] Starting a Group every hour but only from 6 a.m. to 6 p.m.

2008-08-14 04:36:27
Subject: Re: [Networker] Starting a Group every hour but only from 6 a.m. to 6 p.m.
From: Olaf Zaplinski <olaf.zaplinski AT QSC DOT DE>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Thu, 14 Aug 2008 10:32:15 +0200
Ronny Egner schrieb:
Hi List,

is there any possibility to start a group periodically
(i.e. every 60 minutes) but only from 6 a.m. to 6 p.m. ?

That is exactly what we do here. But we need to start a script by cron:

55 7 * * *      root    /root/bin/switch-Level-1-hourly-autostart on
5 17 * * *      root    /root/bin/switch-Level-1-hourly-autostart off


Group name is 'Level 1 hourly', switch-Level-1-hourly-autostart is:

#!/bin/bash

usage()
{
        echo nope.
        exit 1
}

switchstatus()
{
cat << EOF | nsradmin -i - > /dev/null 2>&1
. name:Level 1 hourly
update autostart:$STATUS
quit
EOF
}


if [ -z ${1} ]
then usage
fi

case ${1} in
        on)     STATUS=Enabled
                switchstatus
                ;;
        off)    STATUS=Disabled
                switchstatus
                ;;
        *)      usage
                ;;
esac

To sign off this list, send email to listserv AT listserv.temple DOT edu and type 
"signoff networker" in the body of the email. Please write to networker-request 
AT listserv.temple DOT edu if you have any problems with this list. You can access the 
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER