From 5fb0b1a876f4615d956034ca2482cd0f6eb68960 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 10 Feb 2011 22:13:07 +0100 Subject: [PATCH] Use max(FileIndex) for restarting incomplete Job --- bacula/src/dird/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index ddc1cb0477..9db14e5963 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -345,7 +345,7 @@ bool do_backup(JCR *jcr) /* For incomplete Jobs, we add our own id */ if (jcr->incomplete) { edit_int64(jcr->JobId, ed1); - Mmsg(buf, "SELECT count(*) FROM File WHERE JobId=%s", ed1); + Mmsg(buf, "SELECT max(FileIndex) FROM File WHERE JobId=%s", ed1); if (!db_sql_query(jcr->db, buf.c_str(), db_int64_handler, &job)) { Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); return false; -- 2.39.5