*/
void get_level_since_time(JCR *jcr, char *since, int since_len)
{
- /* Lookup the last
- * FULL backup job to get the time/date for a
+ /* Lookup the last FULL backup job to get the time/date for a
* differential or incremental save.
*/
if (!jcr->stime) {
case L_DIFFERENTIAL:
case L_INCREMENTAL:
/* Look up start time of last job */
- jcr->jr.JobId = 0;
+ jcr->jr.JobId = 0; /* flag for db_find_job_start time */
if (!db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime)) {
Jmsg(jcr, M_INFO, 0, "%s", db_strerror(jcr->db));
Jmsg(jcr, M_INFO, 0, _("No prior or suitable Full backup found. Doing FULL backup.\n"));
bsnprintf(since, since_len, " (upgraded from %s)",
level_to_str(jcr->JobLevel));
- jcr->JobLevel = jcr->jr.Level = L_FULL;
+ jcr->JobLevel = jcr->jr.JobLevel = L_FULL;
} else {
bstrncpy(since, ", since=", since_len);
bstrncat(since, jcr->stime, since_len);
}
- Dmsg1(100, "Last start time = %s\n", jcr->stime);
+ jcr->jr.JobId = jcr->JobId;
break;
}
+ Dmsg2(100, "Level=%c last start time=%s\n", jcr->JobLevel, jcr->stime);
}
fd->msg = edit_job_codes(jcr, fd->msg, p, "");
bpipe = open_bpipe(fd->msg, 0, "r");
if (!bpipe) {
+ berrno be;
Jmsg(jcr, M_FATAL, 0, _("Cannot run program: %s. ERR=%s\n"),
- p, strerror(errno));
+ p, be.strerror());
goto bail_out;
}
/* Copy File options */
} else {
bstrncpy(buf, "0 ", sizeof(buf));
}
- Dmsg1(100, "Opts=%s\n", buf);
+ Dmsg1(500, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, bpipe->rfd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);
- Dmsg2(200, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
+ Dmsg2(500, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
if (!bnet_send(fd)) {
Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
goto bail_out;
}
}
if ((stat=close_bpipe(bpipe)) != 0) {
- Jmsg(jcr, M_FATAL, 0, _("Error running program: %s. RtnStat=%d ERR=%s\n"),
- p, stat, strerror(errno));
+ berrno be;
+ be.set_errno(stat);
+ Jmsg(jcr, M_FATAL, 0, _("Error running program %p: ERR=%s\n"),
+ p, be.strerror());
goto bail_out;
}
break;
} else {
bstrncpy(buf, "0 ", sizeof(buf));
}
- Dmsg1(100, "Opts=%s\n", buf);
+ Dmsg1(500, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, ffd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);
/* Note, fall through wanted */
default:
if (ie->num_opts) {
- Dmsg2(100, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
+ Dmsg2(500, "numopts=%d opts=%s\n", ie->num_opts, NPRT(ie->opts_list[0]->opts));
pm_strcpy(&fd->msg, ie->opts_list[0]->opts);
pm_strcat(&fd->msg, " ");
} else {
pm_strcpy(&fd->msg, "0 ");
}
fd->msglen = pm_strcat(&fd->msg, p);
- Dmsg1(100, "Inc/Exc name=%s\n", fd->msg);
+ Dmsg1(500, "Inc/Exc name=%s\n", fd->msg);
if (!bnet_send(fd)) {
Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
goto bail_out;
goto bail_out;
}
bstrncpy(buf, "F ", sizeof(buf));
- Dmsg1(100, "Opts=%s\n", buf);
+ Dmsg1(500, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, bpipe->rfd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);
- Dmsg2(200, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
+ Dmsg2(500, "Inc/exc len=%d: %s", fd->msglen, fd->msg);
if (!bnet_send(fd)) {
Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
goto bail_out;
}
}
if ((stat=close_bpipe(bpipe)) != 0) {
- Jmsg(jcr, M_FATAL, 0, _("Error running program: %s. RtnStat=%d ERR=%s\n"),
- p, stat, strerror(errno));
+ berrno be;
+ be.set_errno(stat);
+ Jmsg(jcr, M_FATAL, 0, _("Error running program: %s. ERR=%s\n"),
+ p, be.strerror());
goto bail_out;
}
break;
goto bail_out;
}
bstrncpy(buf, "F ", sizeof(buf));
- Dmsg1(100, "Opts=%s\n", buf);
+ Dmsg1(500, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, ffd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);
default:
pm_strcpy(&fd->msg, "F ");
fd->msglen = pm_strcat(&fd->msg, p);
- Dmsg1(100, "Inc/Exc name=%s\n", fd->msg);
+ Dmsg1(500, "Inc/Exc name=%s\n", fd->msg);
if (!bnet_send(fd)) {
Jmsg(jcr, M_FATAL, 0, _(">filed: write error on socket\n"));
goto bail_out;
FILE *bs;
char buf[1000];
BSOCK *fd = jcr->file_bsock;
- char *bootstrap = "bootstrap\n";
+ const char *bootstrap = "bootstrap\n";
Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap);
if (!jcr->RestoreBootstrap) {