* Differential : get the last full id
* Incremental : get the last full + last diff + last incr(s) ids
*
+ * If you specify jr->StartTime, it will be used to limit the search
+ * in the time. (usually now)
+ *
* TODO: look and merge from ua_restore.c
*/
bool db_accurate_get_jobids(JCR *jcr, B_DB *mdb,
char clientid[50], jobid[50], filesetid[50];
char date[MAX_TIME_LENGTH];
POOL_MEM query(PM_FNAME);
- bstrutime(date, sizeof(date), jr->JobTDate + 1);
+
+ /* Take the current time as upper limit if nothing else specified */
+ time_t StartTime = (jr->StartTime)?jr->StartTime:time(NULL);
+
+ bstrutime(date, sizeof(date), StartTime + 1);
jobids[0]='\0';
/* First, find the last good Full backup for this job/client/fileset */