On Thu, 26 May 2011 09:23:22 +0200
Marcello Romani <mrom...@ottotecnica.com> wrote:

> I'd like to share a tip about shutting down a windows client
> after its backuò job has finished.
> Nothing spectacular, but I guessed somebody would find it useful.
> 
> 1) Create a batch file with a suitable name, e.g. C:\shutdown.bat
> 2) Put this single line in it:
> 
> shutdown -s -t 0
> 
> which simply means halt the system (-s) and do it now (-t 0).
> 
> Then in bacula-dir.conf on the host where bacula director runs, edit
> the job resource of the windows client and add this line:
> 
> ClientRunAfterJob = "C:/shutdown.bat"
> 
> The client machine whill shutdown immediataly after the backup job
> has finished.

The batch file is not needed:
Client Run After Job = "shutdown -r -t 30 -f & exit /b 0"
works just fine for us.

We use -t 30 because otherwise sometimes shutdown does its job so fast,
bacula-fd fails to report its completion which marks the whole job as
failed.

That "exit /b 0" trick is not strictly needed here but is anyway useful
for running other commands (for instance, on Windows machines we stop
the antivirus program before making the backup and start it
afterwards--otherwise the performance is horrible) which for some
reason may fail and we do not want it to fail the whole backup job as a
consequence.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to