Hi,
On 6/4/2007 2:37 PM, Adam C=E9cile wrote:
Lucio Crusca a =E9crit :
I'd like configure Bacula so that it turns off the computer after the =
SD has=20
finished writing the backup. I'm running Debian GNU/Linux and Bacula 2=
=2E0.3.=20
Is there a way to do that?
=20
RunAfterCmd ?
Definitely... I use the following in my office:
Job {
Priority =3D 999
Name =3D Shutdown
Type =3D Admin
Run Before Job =3D "/etc/bacula/shutdown.sh"
Schedule =3D Shutdown
Messages =3D Standard
Storage =3D DLT
Fileset =3D Alles
Pool =3D Full
Client =3D goblin-fd
Max Start Delay =3D 20h
Rerun Failed Levels =3D No
}
Note the high priority value.
bacula/root < at > goblin /root # cat /etc/bacula/shutdown.sh
#!/bin/bash
if [ -f /var/bacula/server/allowshutdown ] ; then
echo "Shutdown will take place..."
/var/bacula/server/sched_downtime goblin "`date -d "now + 5 min" \
"+%Y-%m-%d %H:%M:%S"`" "`date "-d tomorrow 8:12"`" 1 0 0 bacula \
"goblin turns off until tomorrow morning..."
/sbin/shutdown -h -t 120 +6 &
else
echo "Shutdown will not happen (/var/bacula/server/allowshutdown=20
not present)"
fi
exit 0
Most of the stuff in the script is for Nagios integration and you can=20
safely ignore it... so your "Run Before Job" line could also simply be=20
"/sbin/shutdown -h -t 120 +6 &" (I'm unsure about the & for background=20
execution - at least it's better to have the shutdown in the background=20
so Bacula can correctly finish the job and won't have a running job left =
in the catalog.)
Arno
Arno
--=20
IT-Service Lehmann al < at > it...
Arno Lehmann
http://www.its-lehmann.de