/*
Bacula® - The Network Backup Solution
- Copyright (C) 2004-2010 Free Software Foundation Europe e.V.
+ Copyright (C) 2004-2012 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
/* Don't let WatchDog checks Max*Time value on this Job */
mig_jcr->no_maxtime = true;
- /* Don't check for duplicates on migration and copy jobs */
- mig_jcr->no_check_duplicates = true;
+ /*
+ * Don't check for duplicates on migration and copy jobs
+ */
+ mig_jcr->job->IgnoreDuplicateJobChecking = true;
Dmsg4(dbglevel, "mig_jcr: Name=%s JobId=%d Type=%c Level=%c\n",
mig_jcr->jr.Name, (int)mig_jcr->jr.JobId,
/*
* set_migration_next_pool() called by do_migration_init()
* at differents stages.
- * The idea here is tofactorize the NextPool's search code and
- * to permit do_migration_init() to return with NextPool set in jcr struct.
+ * The idea here is to make a common subroutine for the
+ * NextPool's search code and to permit do_migration_init()
+ * to return with NextPool set in jcr struct.
*/
static bool set_migration_next_pool(JCR *jcr, POOL **retpool)
{
struct tm tm;
char dt[MAX_TIME_LENGTH];
int count = 0;
+ int limit = 99; /* limit + 1 is max jobs to start */
ids.list = get_pool_memory(PM_MESSAGE);
ids.list[0] = 0;
jcr->get_ActionName(1), ids.list);
Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
+ /*
+ * Note: to not over load the system, limit the number
+ * of new jobs started to 100 (see limit above)
+ */
for (int i=1; i < (int)ids.count; i++) {
JobId = 0;
stat = get_next_jobid_from_list(&p, &JobId);
goto ok_out;
}
jcr->MigrateJobId = JobId;
- start_migration_job(jcr);
- Dmsg0(dbglevel, "Back from start_migration_job\n");
+ /* Don't start any more when limit reaches zero */
+ limit--;
+ if (limit > 0) {
+ start_migration_job(jcr);
+ Dmsg0(dbglevel, "Back from start_migration_job\n");
+ }
}
/* Now get the last JobId and handle it in the current job */
UAContext *ua = new_ua_context(jcr);
char ed1[50];
ua->batch = true;
- Mmsg(ua->cmd, "run job=\"%s\" jobid=%s allowduplicates=yes", jcr->job->name(),
- edit_uint64(jcr->MigrateJobId, ed1));
+ Mmsg(ua->cmd, "run job=\"%s\" jobid=%s ignoreduplicatecheck=yes pool=\"%s\"",
+ jcr->job->name(), edit_uint64(jcr->MigrateJobId, ed1),
+ jcr->pool->name());
Dmsg2(dbglevel, "=============== %s cmd=%s\n", jcr->get_OperationName(), ua->cmd);
parse_ua_args(ua); /* parse command */
JobId_t jobid = run_cmd(ua, ua->cmd);
Dmsg2(100, "Enter migrate_cleanup %d %c\n", TermCode, TermCode);
update_job_end(jcr, TermCode);
- memset(&mr, 0, sizeof(mr));
/*
* Check if we actually did something.