1

I've set up a bacula Job that runs Client scripts before and after backup like this:

Job {
        Name = "my_job"
        Client = "my-fd"
        FileSet = "my-fset"
        Storage = "storage-File"
        Enabled = yes
        Schedule = "my_sched"
        Pool = "pool_full"
        JobDefs = "DefaultJob"
        #Max Start Delay = 3600
        Client Run Before Job = "/path/to/before/script.sh"
        Client Run After Job = "/path/to/after/script.sh"
}

By now is scheduled to run Full backups.

Schedule {
        Name = "my_sched"
        Run = Level=Full Pool="pool_full" mon-sun at 12:50
        }

I want to add a Incremental backup scheduled like this:

Run = Level=Incremental IncrementalPool="pool_incr" FullPool="pool_full" mon-sun at 21:21

Question is:

How to tell bacula that Incremental backup must not run Client scripts?

2

Solution I found is providing JobLevel to the script as a argument with %l

    Client Run Before Job = "/path/to/before/script.sh %l"
    Client Run After Job = "/path/to/after/script.sh %l"

and arranging scripts like this:

#!/bin/bash
BACULA_J_LEVEL=$1

case $BACULA_J_LEVEL in

 Full)
  echo "Job Level $BACULA_J_LEVEL";
  #do stuff here
  exit 0
  ;;

 Differential)

  echo "Job Level $BACULA_J_LEVEL";
  # do nothing
  exit 0
  ;;

 Incremental)
  echo "Job Level $BACULA_J_LEVEL";
  # do nothing
  exit 0
  ;;

 *)

  echo "Level not recognized";
  exit 1;
  ;;

esac

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.