Amanda-Users

Re: Automatically shutdown after a backup

2006-11-23 19:11:56
Subject: Re: Automatically shutdown after a backup
From: "chuck.amadi" <chuck.amadi AT ntlworld DOT com>
To: amanda <amanda-users AT amanda DOT org>
Date: Fri, 24 Nov 2006 00:03:37 +0000
Nick Pierpoint wrote:

Hello everyone.

I'm looking for a way to automatically shutdown my computers on my small
home network following a backup.

i.e.
1. Amanda completes backup run
2. Backed-up clients shutdown
3. Amanda server shutdown

Thanks for any pointers.

Hi Nick

a possible suggestion is to write a shell scipt and as a command add to a cron job for all your computers. Thus create a user with neccessary permissions to start and shutdown services But not as Root Well I don't by convention it is not wise to run cron jobs if your server or client is exposed to the Wild Wild West.

Example of a shell script::

#!/bash/sh
# shutdown-pcs.sh Created YYMMDD By ***
# Save hack to /usr/local/bin and ensure your user has permissions to run from this path or any other you decide.
# Or you can use sudo.
# Simple hack to shutdown computer after Amanda backup run.
# chmod o+x or 775
# Preferable a User with sufficent permissions.
echo "Shutting down computer"
shutdown -h now

Thus run crontab -e -u admin
Example of a cron job for your privillege user say for instance user admin

# Shutting down computer
30 19 * * * /usr/local/bin/shutdown-pcs.sh

Cheers



Cheers

<Prev in Thread] Current Thread [Next in Thread>