*/
/*
- Copyright (C) 2000-2003 Kern Sibbald and John Walker
+ Copyright (C) 2000-2004 Kern Sibbald and John Walker
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
jcr->JobId, jcr->Job);
/*
- * Get the Pool record
+ * Get the Pool record -- first apply any level defined pools
*/
+ switch (jcr->JobLevel) {
+ case L_FULL:
+ if (jcr->full_pool) {
+ jcr->pool = jcr->full_pool;
+ }
+ break;
+ case L_INCREMENTAL:
+ if (jcr->inc_pool) {
+ jcr->pool = jcr->inc_pool;
+ }
+ break;
+ case L_DIFFERENTIAL:
+ if (jcr->dif_pool) {
+ jcr->pool = jcr->dif_pool;
+ }
+ break;
+ }
memset(&pr, 0, sizeof(pr));
bstrncpy(pr.Name, jcr->pool->hdr.name, sizeof(pr.Name));
+
while (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */
/* Try to create the pool */
if (create_pool(jcr, jcr->db, jcr->pool, POOL_OP_CREATE) < 0) {
msg_type = M_INFO; /* by default INFO message */
switch (jcr->JobStatus) {
case JS_Terminated:
- term_msg = _("Backup OK");
+ if (jcr->Errors || jcr->SDErrors) {
+ term_msg = _("Backup OK -- with warnings");
+ } else {
+ term_msg = _("Backup OK");
+ }
break;
case JS_FatalError:
case JS_ErrorTerminated:
msg_type = M_ERROR; /* Generate error message */
if (jcr->store_bsock) {
bnet_sig(jcr->store_bsock, BNET_TERMINATE);
- pthread_cancel(jcr->SD_msg_chan);
+ if (jcr->SD_msg_chan) {
+ pthread_cancel(jcr->SD_msg_chan);
+ }
}
break;
case JS_Canceled:
term_msg = _("Backup Canceled");
if (jcr->store_bsock) {
bnet_sig(jcr->store_bsock, BNET_TERMINATE);
- pthread_cancel(jcr->SD_msg_chan);
+ if (jcr->SD_msg_chan) {
+ pthread_cancel(jcr->SD_msg_chan);
+ }
}
break;
default:
jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg));
jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg));
+// bmicrosleep(15, 0); /* for debugging SIGHUP */
+
Jmsg(jcr, msg_type, 0, _("Bacula " VERSION " (" LSMDATE "): %s\n\
JobId: %d\n\
Job: %s\n\