From 9a9f78da40409c5297482abaa42962cd0b89c38c Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 14 Jul 2009 14:56:29 +0000 Subject: [PATCH] ebl Small fix on accurate code for new restore menu option git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8992 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/sql_get.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 74b807ece5..b9d25bbc11 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -1094,6 +1094,9 @@ bool db_get_file_list(JCR *jcr, B_DB *mdb, char *jobids, * 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, @@ -1103,7 +1106,11 @@ 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 */ -- 2.39.5