Contributors:
+Adam Thorton
Adrew J. Millar
Adrian Close
Aleksandar Milivojevic
{"rescheduleinterval", store_time, ITEM(res_job.RescheduleInterval), 0, ITEM_DEFAULT, 60 * 30},
{"rescheduletimes", store_pint, ITEM(res_job.RescheduleTimes), 0, 0, 0},
{"priority", store_pint, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10},
- {"writepartafterjob", store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, false},
+ {"writepartafterjob", store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, true},
{"selectionpattern", store_str, ITEM(res_job.selection_pattern), 0, 0, 0},
{"selectiontype", store_migtype, ITEM(res_job.selection_type), 0, 0, 0},
{"runscript", store_runscript, ITEM(res_job.RunScripts), 0, ITEM_NO_EQUALS, 0},
if (jcr->previous_jr.JobId == 0) {
Dmsg1(dbglevel, "JobId=%d no previous JobId\n", (int)jcr->JobId);
+ Jmsg(jcr, M_INFO, 0, _("No previous Job found to migrate.\n"));
return true; /* no work */
}
if (!get_or_create_fileset_record(jcr)) {
Dmsg1(dbglevel, "JobId=%d no FileSet\n", (int)jcr->JobId);
+ Jmsg(jcr, M_FATAL, 0, _("Could not get or create the FileSet record.\n"));
return false;
}
jcr->jr.PoolId = get_or_create_pool_record(jcr, jcr->pool->hdr.name);
if (jcr->jr.PoolId == 0) {
Dmsg1(dbglevel, "JobId=%d no PoolId\n", (int)jcr->JobId);
+ Jmsg(jcr, M_FATAL, 0, _("Could not get or create a Pool record.\n"));
return false;
}
if (jcr->previous_jr.JobId == 0 || jcr->ExpectedFiles == 0) {
set_jcr_job_status(jcr, JS_Terminated);
Dmsg1(dbglevel, "JobId=%d expected files == 0\n", (int)jcr->JobId);
+ if (jcr->previous_jr.JobId == 0) {
+ Jmsg(jcr, M_INFO, 0, _("No previous Job found to migrate.\n"));
+ } else {
+ Jmsg(jcr, M_INFO, 0, _("Previous Job has no data to migrate.\n"));
+ }
migration_cleanup(jcr, jcr->JobStatus);
return true; /* no work */
}
if (((STORE *)jcr->rstorage->first())->name() == ((STORE *)jcr->wstorage->first())->name()) {
Jmsg(jcr, M_FATAL, 0, _("Read storage \"%s\" same as write storage.\n"),
((STORE *)jcr->rstorage->first())->name());
+ return false;
}
if (!start_storage_daemon_job(jcr, jcr->rstorage, jcr->wstorage)) {
return false;
* for each of them. For the last JobId, we handle it below.
*/
p = ids.list;
+ if (ids.count == 0) {
+ Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
+ goto ok_out;
+ }
Jmsg(jcr, M_INFO, 0, _("The following %u JobId%s will be migrated: %s\n"),
ids.count, ids.count==0?"":"s", ids.list);
Dmsg2(dbglevel, "Before loop count=%d ids=%s\n", ids.count, ids.list);
goto bail_out;
} else if (stat == 0) {
Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
- goto ok_out;
+ goto bail_out;
}
}
goto bail_out;
} else if (stat == 0) {
Jmsg(jcr, M_INFO, 0, _("No JobIds found to migrate.\n"));
- goto ok_out;
+ goto bail_out;
}
jcr->previous_jr.JobId = JobId;
/*
* Items needed:
* mr.PoolId must be set
- * jcr->store
+ * jcr->wstore
* jcr->db
* jcr->pool
* MEDIA_DBR mr (zeroed out)
/* Nothing found */
return NULL;
}
+
/*
* Fill in the remaining fields of the jcr as if it
* is going to run the job.
if (ok) {
mr.PoolId = jcr->jr.PoolId;
mr.StorageId = sp->store->StorageId;
+ jcr->wstore = sp->store;
ok = find_next_volume_for_append(jcr, &mr, 1, false/*no create*/);
}
if (!ok) {
db_close_database(jcr, jcr->db);
}
jcr->db = ua->db; /* restore ua db to jcr */
-
}
/*
#endif
/* Forward referenced functions */
-void set_os_device_parameters(DEVICE *dev);
+void set_os_device_parameters(DCR *dcr);
static bool dev_get_os_pos(DEVICE *dev, struct mtget *mt_stat);
static char *mode_to_str(int mode);
}
dev_errno = 0;
lock_door();
- set_os_device_parameters(this); /* do system dependent stuff */
+ set_os_device_parameters(dcr); /* do system dependent stuff */
break; /* Successfully opened and rewound */
}
}
}
-void set_os_device_parameters(DEVICE *dev)
+void set_os_device_parameters(DCR *dcr)
{
+ DEVICE *dev = dcr->dev;
+
#if defined(HAVE_LINUX_OS) || defined(HAVE_WIN32)
struct mtop mt_com;
dev->clrerror(MTSETBSIZ);
}
}
+/* Turn this on later when fully tested */
+#if defined(xxxMTIOCSETEOTMODEL)
+ uint32_t neof;
+ if (dev_cap(dev, CAP_TWOEOF)) {
+ neof = 2;
+ } else {
+ neof = 1;
+ }
+ if (ioctl(dev->fd, MTIOCSETEOTMODEL, (caddr_t)&neof) < 0) {
+ berrno be;
+ dev->dev_errno = errno; /* save errno */
+ Mmsg2(dev->errmsg, _("Unable to set eotmodel on device %s: ERR=%s\n"),
+ dev->print_name(), be.strerror(dev->dev_errno));
+ Jmsg(dcr->jcr, M_FATAL, 0, dev->errmsg);
+ }
+#endif
return;
#endif
#undef VERSION
#define VERSION "1.39.29"
-#define BDATE "19 November 2006"
-#define LSMDATE "19Nov06"
+#define BDATE "20 November 2006"
+#define LSMDATE "20Nov06"
#define BYEAR "2006" /* year for copyright messages in progs */
/* Debug flags */
Technical notes on version 1.39
General:
+20Nov06
+kes Make WritePartAfterJob the default so that the last DVD part
+ always gets written to the DVD by default.
+kes Add additional error messages in migration.
+kes Suppress redundant error messages in migration (possibly more to do).
+kes Apply Martin's fix (updated to 1.39) that takes into account
+ run storage overrides in the Director status display.
+kes Implement, but turn off the submitted code that sets the EOT
+ model on FreeBSD machines. Turning on this code is too risky at
+ this point in the development.
19Nov06
kes Implement unique dbid routine for migration to prevent the same
JobId from being migrated twice. This should fix bug #709.