Answer the question
In order to leave comments, you need to log in
Bacula, executing scripts after backup?
Good afternoon.
We use Bacula for backup, after backup on the client, Bacula runs a script that additionally presses the necessary data with tar.
In the director settings in the job for the client, it looks like this:
Run Script {
Runs When = After
Runs On Client = yes
Runs On Success = yes
Runs On Failure = no
Fail Job On Error = no
Command = "sh /home/test2.sh"
}
Command = "sh /home/test2.sh &"
Answer the question
In order to leave comments, you need to log in
mycommand.sh | at now » tried this design? you can add at now + 1 hour. Try like this.
Bacula waits for all child processes to terminate. In other words, you will not leave the task “in the background” if your processes are launched from bacula - even if you fork in the script and kill the parent, the bacula will pick up the orphan and wait for it to complete. It is logical, because the serialization of tasks in the bacula is done to speed up each of them: so that the systems do not “spray” during execution, performing each of the tasks and everything in general faster.
You can partially get around this by specifying Maximum Concurrent Jobs greater than 1 in the Client, Storage, Director resources (where necessary). Then the system will be able to start other tasks, despite the fact that this task is still running.
Perhaps another solution is to deploy the backup you just made from bakula and pack it into tar already. If memory is right now, restore jobs work differently with these limits on the number of simultaneous tasks.
In general, I have a strong feeling that you are using it incorrectly, or rather, your backup architecture is wrong. What do you need this tar for? If this is a "second backup", why is it running from bacula if it has nothing to do with it? Trying to serialize tasks? Well, you have them serialized correctly, the disk and other resources are busy with one specific task at any given time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question