bool have_full;
bool do_full = false;
bool do_diff = false;
- time_t now;
- utime_t full_time;
- utime_t diff_time;
+ utime_t now;
+ utime_t last_full_time;
+ utime_t last_diff_time;
since[0] = 0;
/* If job cloned and a since time already given, use it */
case L_INCREMENTAL:
POOLMEM *stime = get_pool_memory(PM_MESSAGE);
/* Look up start time of last Full job */
- now = time(NULL);
+ now = (utime_t)time(NULL);
jcr->jr.JobId = 0; /* flag to return since time */
have_full = db_find_job_start_time(jcr, jcr->db, &jcr->jr, &jcr->stime);
/* If there was a successful job, make sure it is recent enough */
if (jcr->get_JobLevel() == L_INCREMENTAL && have_full && jcr->job->MaxDiffInterval > 0) {
/* Lookup last diff job */
if (db_find_last_job_start_time(jcr, jcr->db, &jcr->jr, &stime, L_DIFFERENTIAL)) {
- diff_time = str_to_utime(stime);
- do_diff = ((now - diff_time) <= jcr->job->MaxDiffInterval);
+ last_diff_time = str_to_utime(stime);
+ do_diff = ((now - last_diff_time) >= jcr->job->MaxDiffInterval);
}
}
if (have_full && jcr->job->MaxFullInterval > 0 &&
db_find_last_job_start_time(jcr, jcr->db, &jcr->jr, &stime, L_FULL)) {
- full_time = str_to_utime(stime);
- do_full = ((now - full_time) <= jcr->job->MaxFullInterval);
+ last_full_time = str_to_utime(stime);
+ do_full = ((now - last_full_time) >= jcr->job->MaxFullInterval);
}
free_pool_memory(stime);
bool send_level_command(JCR *jcr)
{
BSOCK *fd = jcr->file_bsock;
- const char *accurate=jcr->job->accurate?"accurate_":"";
- const char *not_accurate="";
+ const char *accurate = jcr->job->accurate?"accurate_":"";
+ const char *not_accurate = "";
/*
* Send Level command to File daemon
*/
char *p, *fn;
char Digest[MAXSTRING]; /* either Verify opts or MD5/SHA1 digest */
- jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen);
if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Digest)) != 3) {
Jmsg(jcr, M_FATAL, 0, _("<filed: bad attributes, expected 3 fields got %d\n"
"msglen=%d msg=%s\n"), len, fd->msglen, fd->msg);
}
}
/* Any cached attr is flushed so we can reuse jcr->attr and jcr->ar */
- fn = jcr->fname;
+ fn = jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen);
while (*p != 0) {
*fn++ = *p++; /* copy filename */
}