On 5/28/17 5:34 AM, 'Tilman Glotzner' via bareos-users wrote:
Some of the computers, I want to backup are not necessarily switch
on when I run their backup jobs. So I run a bash script via "Run
before" that pings them, and if that fails, wakes them up via
etherwake. Depending on whether they were already running when I
pinged them, I would like to shut them down after the backup job. I
computer that runs I assume to be in use, and hence I would like to
leave it running after the backup. And one that I had to wake up for
the backup I would like to put back to sleep after the backup.
Putting a windows machine back to sleep I can do via starting
shutdown.exe using "Client Run After Job". Is it however possible to
do this conditionally, i.e. depending on the bash script that runs
on a different machine via "Run Before" and pings the windows machine
to be backed up?.
What about slightly different approach? Define a 2nd backup for the
workstations, lets call it the "shutdown" backup. Make that backup a
very small FileSet, say nothing more than a single file so it runs
really quickly and you don't care about the backup space it adds. The
"shutdown" backup will have the RunAfterJob that does the shutdown. The
"shutdown" job doesn't run by default, it has a Schedule that causes it
to never run automatically.
Have your RunBefore job (which runs on the director, right?) Run the
"shutdown" job if it wakes up the machine. Because that RunBefore job
with the etherwake has the smarts to know if the workstation needs to be
shutdown again or not. Just have it echo the Run command to bconsole to
add the "shutdown" job if it ran etherwake for that workstation.
Might want to set the Priority one higher than your normal backup jobs.
But since the job for the client is already running, you may not need
to. At worse the "shutdown" jobs won't run until all the other backups
are done.
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.