/*
* Open connection with File daemon.
- * Try connecting every 10 seconds, give up after 1 hour.
+ * Try connecting every retry_interval (default 10 sec), and
+ * give up after max_retry_time (default 30 mins).
*/
int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time,
return 1;
}
-
+/*
+ * This subroutine edits the last job start time into a
+ * "since=date/time" buffer that is returned in the
+ * variable since. This is used for display purposes in
+ * the job report. The time in jcr->stime is later
+ * passed to tell the File daemon what to do.
+ */
void get_level_since_time(JCR *jcr, char *since, int since_len)
{
/* Lookup the last
bstrncpy(since, ", since=", since_len);
bstrncat(since, jcr->stime, since_len);
}
- Dmsg1(115, "Last start time = %s\n", jcr->stime);
+ Dmsg1(100, "Last start time = %s\n", jcr->stime);
break;
}
}
/*
- * Send level command for backup and estimate
+ * Send level command to FD.
+ * Used for backup jobs and estimate command.
*/
int send_level_command(JCR *jcr)
{
BSOCK *fd = jcr->file_bsock;
+ utime_t stime;
+ char ed1[50];
/*
* Send Level command to File daemon
*/
case L_BASE:
bnet_fsend(fd, levelcmd, "base", " ", 0);
break;
+ /* L_NONE is the console, sending something off to the FD */
+ case L_NONE:
case L_FULL:
bnet_fsend(fd, levelcmd, "full", " ", 0);
break;
case L_DIFFERENTIAL:
case L_INCREMENTAL:
- bnet_fsend(fd, levelcmd, "since ", jcr->stime, 0);
+// bnet_fsend(fd, levelcmd, "since ", jcr->stime, 0); /* old code, deprecated */
+ stime = str_to_utime(jcr->stime);
+ bnet_fsend(fd, levelcmd, "since_utime ", edit_uint64(stime, ed1), 0);
+ while (bget_dirmsg(fd) >= 0) { /* allow him to poll us to sync clocks */
+ Jmsg(jcr, M_INFO, 0, "%s\n", fd->msg);
+ }
break;
case L_SINCE:
default:
p = (char *)ie->name_list.get(j);
switch (*p) {
case '|':
+ p++; /* skip over the | */
fd->msg = edit_job_codes(jcr, fd->msg, p, "");
bpipe = open_bpipe(fd->msg, 0, "r");
if (!bpipe) {
} else {
bstrncpy(buf, "0 ", sizeof(buf));
}
- Dmsg1(000, "Opts=%s\n", buf);
+ Dmsg1(100, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, bpipe->rfd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);
} else {
bstrncpy(buf, "0 ", sizeof(buf));
}
- Dmsg1(000, "Opts=%s\n", buf);
+ Dmsg1(100, "Opts=%s\n", buf);
optlen = strlen(buf);
while (fgets(buf+optlen, sizeof(buf)-optlen, ffd)) {
fd->msglen = Mmsg(&fd->msg, "%s", buf);