+ if (rc.regexwhere) {
+ if (jcr->RegexWhere) {
+ free(jcr->RegexWhere);
+ }
+ jcr->RegexWhere = bstrdup(rc.regexwhere);
+ rc.regexwhere = NULL;
+ }
+
+ if (rc.when) {
+ jcr->sched_time = str_to_utime(rc.when);
+ if (jcr->sched_time == 0) {
+ ua->send_msg(_("Invalid time, using current time.\n"));
+ jcr->sched_time = time(NULL);
+ }
+ rc.when = NULL;
+ }
+
+ if (rc.bootstrap) {
+ if (jcr->RestoreBootstrap) {
+ free(jcr->RestoreBootstrap);
+ }
+ jcr->RestoreBootstrap = bstrdup(rc.bootstrap);
+ rc.bootstrap = NULL;
+ }
+
+ if (rc.plugin_options) {
+ if (jcr->plugin_options) {
+ free(jcr->plugin_options);
+ }
+ jcr->plugin_options = bstrdup(rc.plugin_options);
+ rc.plugin_options = NULL;
+ }
+
+
+ if (rc.replace) {
+ jcr->replace = 0;
+ for (i=0; ReplaceOptions[i].name; i++) {
+ if (strcasecmp(rc.replace, ReplaceOptions[i].name) == 0) {
+ jcr->replace = ReplaceOptions[i].token;
+ }
+ }
+ if (!jcr->replace) {
+ ua->send_msg(_("Invalid replace option: %s\n"), rc.replace);
+ return false;
+ }
+ } else if (rc.job->replace) {
+ jcr->replace = rc.job->replace;
+ } else {
+ jcr->replace = REPLACE_ALWAYS;
+ }
+ rc.replace = NULL;
+
+ if (rc.Priority) {
+ jcr->JobPriority = rc.Priority;
+ rc.Priority = 0;
+ }
+
+ if (rc.since) {
+ if (!jcr->stime) {
+ jcr->stime = get_pool_memory(PM_MESSAGE);
+ }
+ pm_strcpy(jcr->stime, rc.since);
+ rc.since = NULL;
+ }
+
+ if (rc.cloned) {
+ jcr->cloned = rc.cloned;
+ rc.cloned = false;
+ }
+
+
+ /* If pool changed, update migration write storage */
+ if (jcr->get_JobType() == JT_MIGRATE || jcr->get_JobType() == JT_COPY ||
+ (jcr->get_JobType() == JT_BACKUP && jcr->get_JobLevel() == L_VIRTUAL_FULL)) {
+ if (!set_migration_wstorage(jcr, rc.pool)) {
+ return false;
+ }
+ }
+ rc.replace = ReplaceOptions[0].name;
+ for (i=0; ReplaceOptions[i].name; i++) {
+ if (ReplaceOptions[i].token == jcr->replace) {
+ rc.replace = ReplaceOptions[i].name;
+ }
+ }
+ if (rc.level_name) {
+ if (!get_level_from_name(jcr, rc.level_name)) {
+ ua->send_msg(_("Level \"%s\" not valid.\n"), rc.level_name);
+ return false;
+ }
+ rc.level_name = NULL;
+ }
+ if (rc.jid) {
+ /* Note, this is also MigrateJobId */
+ jcr->RestoreJobId = str_to_int64(rc.jid);
+ rc.jid = 0;
+ }
+ return true;