Hi,

On 6/4/2007 2:37 PM, Adam Cécile wrote:
> Lucio Crusca a écrit :
>> I'd like configure Bacula so that it turns off the computer after the SD has 
>> finished writing the backup. I'm running Debian GNU/Linux and Bacula 2.0.3. 
>> Is there a way to do that?
>>
>>   
> RunAfterCmd ?

Definitely... I use the following in my office:

Job {
   Priority = 999
   Name = Shutdown
   Type = Admin
   Run Before Job = "/etc/bacula/shutdown.sh"
   Schedule = Shutdown
   Messages = Standard
   Storage = DLT
   Fileset = Alles
   Pool = Full
   Client = goblin-fd
   Max Start Delay = 20h
   Rerun Failed Levels = No
}

Note the high priority value.

bacula/[EMAIL PROTECTED] /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 
not present)"
fi
exit 0

Most of the stuff in the script is for Nagios integration and you can 
safely ignore it... so your "Run Before Job" line could also simply be 
"/sbin/shutdown -h -t 120 +6 &" (I'm unsure about the & for background 
execution - at least it's better to have the shutdown in the background 
so Bacula can correctly finish the job and won't have a running job left 
in the catalog.)

Arno


Arno
-- 
IT-Service Lehmann                    [EMAIL PROTECTED]
Arno Lehmann                  http://www.its-lehmann.de


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to