{"prunejobs", store_bool, ITEM(res_job.PruneJobs), 0, ITEM_DEFAULT, false},
{"prunefiles", store_bool, ITEM(res_job.PruneFiles), 0, ITEM_DEFAULT, false},
{"prunevolumes",store_bool, ITEM(res_job.PruneVolumes), 0, ITEM_DEFAULT, false},
+ {"purgemigratejob", store_bool, ITEM(res_job.PurgeMigrateJob), 0, ITEM_DEFAULT, false},
{"enabled", store_bool, ITEM(res_job.enabled), 0, ITEM_DEFAULT, true},
{"spoolattributes",store_bool, ITEM(res_job.SpoolAttributes), 0, ITEM_DEFAULT, false},
{"spooldata", store_bool, ITEM(res_job.spool_data), 0, ITEM_DEFAULT, false},
bool CancelLowerLevelDuplicates; /* Cancel lower level backup jobs */
bool CancelQueuedDuplicates; /* Cancel queued jobs */
bool CancelRunningDuplicates; /* Cancel Running jobs */
+ bool PurgeMigrateJob; /* Purges source job on completion */
+
alist *base; /* Base jobs */
/* Methods */
Mmsg(query, "UPDATE Log SET JobId=%s WHERE JobId=%s",
new_jobid, old_jobid);
db_sql_query(mig_jcr->db, query.c_str(), NULL, NULL);
- /* Purge all old file records, but leave Job record */
- purge_files_from_jobs(ua, old_jobid);
+
+ if (jcr->job->PurgeMigrateJob) {
+ /* Purge old Job record */
+ purge_jobs_from_catalog(ua, old_jobid);
+ } else {
+ /* Purge all old file records, but leave Job record */
+ purge_files_from_jobs(ua, old_jobid);
+ }
+
free_ua_context(ua);
}