Job {
  Name = "copy"
  Type = Copy
  Pool = Full
  Selection Type = SQL Query
  Selection Pattern = "WITH pids AS
            ( SELECT poolid FROM pool WHERE name = 'Full' )
            SELECT jobid FROM job j, pids p
            WHERE j.poolid=p.poolid
            AND type='B'
            AND jobstatus IN ('T','W')
            AND priorjobid = 0;"
  Client = "bareos-fd"
  Messages = Standard
  Run Script {
    Runs On Client = No
    Runs When = Before
    Command = "echo 'prevjobid=%O newjobid=%N'"
  }
  Run Script {
    Runs On Client = No
    Runs When = After
    Command = "echo 'prevjobid=%O newjobid=%N'"
  }
}
