Job {
  Name = "migrate"
  Type = Migrate
  Pool = FullCopy
  Selection Type = SQL Query
  Selection Pattern = "WITH pids AS
            ( SELECT poolid FROM pool WHERE name = 'FullCopy' )
            SELECT jobid FROM job j, pids p
            WHERE j.poolid=p.poolid
            AND type='C'
            AND jobstatus IN ('T','W');"
  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'"
  }
}
