Skip to content

Commit

Permalink
Merge pull request #1135
Browse files Browse the repository at this point in the history
cats: include only jobtypes in `list jobtotals` that write data to volumes
  • Loading branch information
pstorz committed Mar 23, 2022
2 parents d15583f + feba96f commit 2647f86
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and since Bareos version 20 this project adheres to [Semantic Versioning](https:
- Virtual Full will now terminate if one if the input jobs had its files pruned [PR #1070]
- webui: new login screen background and adapted logo to support Ukraine [PR #1122]
- console: multicolumn output: fill columns first [PR #1072]
- cats: include only jobtypes in `list jobtotals` that write data to volumes [PR #1135]

### Deprecated

Expand Down
14 changes: 9 additions & 5 deletions core/src/cats/sql_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2000-2009 Free Software Foundation Europe e.V.
Copyright (C) 2011-2016 Planets Communications B.V.
Copyright (C) 2013-2019 Bareos GmbH & Co. KG
Copyright (C) 2013-2022 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
Expand Down Expand Up @@ -599,9 +599,11 @@ void BareosDb::ListJobTotals(JobControlRecord* jcr,
DbLocker _{this};

// List by Job
// JobTypes BACKUP(B),ARCHIVE(A,a), JOB_COPY(C)
Mmsg(cmd,
"SELECT count(*) AS Jobs,sum(JobFiles) "
"AS Files,sum(JobBytes) AS Bytes,Name AS Job FROM Job GROUP BY Name");
"SELECT COUNT(*) AS Jobs, SUM(JobFiles) "
"AS Files, SUM(JobBytes) AS Bytes, Name AS Job FROM Job WHERE Type IN "
"('B','A','a','C') GROUP BY Name");

if (!QUERY_DB(jcr, cmd)) { return; }

Expand All @@ -612,9 +614,11 @@ void BareosDb::ListJobTotals(JobControlRecord* jcr,
SqlFreeResult();

// Do Grand Total
// JobTypes BACKUP(B),ARCHIVE(A,a), JOB_COPY(C)
Mmsg(cmd,
"SELECT COUNT(*) AS Jobs,sum(JobFiles) "
"AS Files,sum(JobBytes) As Bytes FROM Job");
"SELECT COUNT(*) AS Jobs, SUM(JobFiles) "
"AS Files, SUM(JobBytes) AS Bytes FROM Job WHERE Type IN "
"('B','A','a','C')");

if (!QUERY_DB(jcr, cmd)) { return; }

Expand Down

0 comments on commit 2647f86

Please sign in to comment.