From 2b9ae30654be2dde1970ecddad52b9081d9d9ace Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 5 Jun 2017 18:25:12 +0200 Subject: [PATCH] Fix getmsg to handle additional forms of Progress messages --- bacula/src/dird/getmsg.c | 2 ++ bacula/src/filed/backup.c | 4 ++-- bacula/src/filed/restore.c | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index e05e63b584..748a3d3bd5 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -279,6 +279,8 @@ int bget_dirmsg(BSOCK *bs) uint64_t bytes; if ((sscanf(bs->msg, "Progress JobId=%ld files=%ld bytes=%lld bps=%ld\n", &JobId, &files, &bytes, &bps) == 4) || + (sscanf(bs->msg, "Progress JobId=x files=%ld bytes=%lld bps=%ld\n", + &files, &bytes, &bps) == 3) || (sscanf(bs->msg, "Progress Job=x files=%ld bytes=%lld bps=%ld\n", &files, &bytes, &bps) == 3)) { Dmsg2(900, "JobId=%d %s", jcr->JobId, bs->msg); diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 6e06cbd3d3..02c907b983 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -245,8 +245,8 @@ int save_file(JCR *jcr, FF_PKT *ff_pkt, bool top_level) jcr->last_stat_time = now; jcr->stat_interval = 30; /* Default 30 seconds */ } else if (now >= jcr->last_stat_time + jcr->stat_interval) { - jcr->dir_bsock->fsend("Progress JobId=x files=%ld bytes=%lld bps=%ld\n", - jcr->JobFiles, jcr->JobBytes, jcr->LastRate); + jcr->dir_bsock->fsend("Progress JobId=%ld files=%ld bytes=%lld bps=%ld\n", + jcr->JobId, jcr->JobFiles, jcr->JobBytes, jcr->LastRate); jcr->last_stat_time = now; } diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 7e5a3c8e25..cedd5fa05b 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -455,8 +455,8 @@ void do_restore(JCR *jcr) jcr->last_stat_time = now; jcr->stat_interval = 30; /* Default 30 seconds */ } else if (now >= jcr->last_stat_time + jcr->stat_interval) { - jcr->dir_bsock->fsend("Progress JobId=x files=%ld bytes=%lld bps=%ld\n", - jcr->JobFiles, jcr->JobBytes, jcr->LastRate); + jcr->dir_bsock->fsend("Progress JobId=%ld files=%ld bytes=%lld bps=%ld\n", + jcr->JobId, jcr->JobFiles, jcr->JobBytes, jcr->LastRate); jcr->last_stat_time = now; } -- 2.39.5