* run [job=]<job-name> level=<level-name>
*
* For Restore Jobs
- * run <job-name> jobid=nn
+ * run <job-name>
*
* Returns: 0 on error
* JobId if OK
char *where, *fileset_name, *client_name, *bootstrap;
const char *replace;
char *when, *verify_job_name, *catalog_name;
+ char *migration_job_name;
char *since = NULL;
char *verify_list;
bool cloned = false;
bool kw_ok;
JOB *job = NULL;
JOB *verify_job = NULL;
+ JOB *migration_job = NULL;
STORE *store = NULL;
CLIENT *client = NULL;
FILESET *fileset = NULL;
"since", /* 18 since */
"cloned", /* 19 cloned */
"verifylist", /* 20 verify output list */
+ "migrationjob", /* 21 migration job name */
NULL};
#define YES_POS 14
bootstrap = NULL;
replace = NULL;
verify_job_name = NULL;
+ migration_job_name = NULL;
catalog_name = NULL;
verify_list = NULL;
verify_list = ua->argv[i];
kw_ok = true;
break;
+ case 21: /* Migration Job */
+ if (migration_job_name) {
+ bsendmsg(ua, _("Migration Job specified twice.\n"));
+ return 0;
+ }
+ migration_job_name = ua->argv[i];
+ kw_ok = true;
+ break;
+
default:
break;
verify_job = job->verify_job;
}
+ if (migration_job_name) {
+ migration_job = (JOB *)GetResWithName(R_JOB, migration_job_name);
+ if (!migration_job) {
+ bsendmsg(ua, _("Migration Job \"%s\" not found.\n"), migration_job_name);
+ migration_job = select_job_resource(ua);
+ }
+ } else {
+ migration_job = job->verify_job;
+ }
+
+
/*
* Create JCR to run job. NOTE!!! after this point, free_jcr()
* before returning.
set_jcr_defaults(jcr, job);
jcr->verify_job = verify_job;
+ jcr->migration_job = migration_job;
set_storage(jcr, store);
jcr->client = client;
jcr->fileset = fileset;
jcr->JobPriority);
}
break;
+ case JT_MIGRATE:
+ jcr->JobLevel = L_FULL; /* default level */
+ bsendmsg(ua, _("Run Restore job\n"
+ "JobName: %s\n"
+ "Bootstrap: %s\n"
+ "Where: %s\n"
+ "Replace: %s\n"
+ "FileSet: %s\n"
+ "Client: %s\n"
+ "Storage: %s\n"
+ "Migration Job: %s\n"
+ "When: %s\n"
+ "Catalog: %s\n"
+ "Priority: %d\n"),
+ job->hdr.name,
+ NPRT(jcr->RestoreBootstrap),
+ jcr->where?jcr->where:NPRT(job->RestoreWhere),
+ replace,
+ jcr->fileset->hdr.name,
+ jcr->client->hdr.name,
+ jcr->store->hdr.name,
+ jcr->migration_job->hdr.name,
+ bstrutime(dt, sizeof(dt), jcr->sched_time),
+ jcr->catalog->hdr.name,
+ jcr->JobPriority);
+ break;
default:
bsendmsg(ua, _("Unknown Job Type=%d\n"), jcr->JobType);
goto bail_out;