Bug 36325 - Add option to koha-run-backups/koha-dump, to exclude logs
Summary: Add option to koha-run-backups/koha-dump, to exclude logs
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Danyon Sewell
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-15 00:54 UTC by Danyon Sewell
Modified: 2024-05-29 12:13 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00


Attachments
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs (5.61 KB, patch)
2024-03-15 01:25 UTC, Danyon Sewell
Details | Diff | Splinter Review
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs (5.58 KB, patch)
2024-03-15 01:27 UTC, Danyon Sewell
Details | Diff | Splinter Review
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs (5.63 KB, patch)
2024-03-23 08:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 36325: Add --exclude-logs option to koha-run-backups (988 bytes, patch)
2024-03-24 22:30 UTC, Danyon Sewell
Details | Diff | Splinter Review
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs (5.68 KB, patch)
2024-05-10 15:39 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 36325: Add --exclude-logs option to koha-run-backups (1.02 KB, patch)
2024-05-10 15:41 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Danyon Sewell 2024-03-15 00:54:32 UTC
Adding an additional option to koha-dump and koha-run-backups to exclude the logs in /var/log/koha/site from the completed backup.
Comment 1 Danyon Sewell 2024-03-15 01:25:39 UTC
Created attachment 163157 [details] [review]
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs

Written patch to add flag to both koha-dump and koha-run-backups.

Test plan:
1. do a sudo koha-dump and sudo koha-run-backups and check the contents of the .tar.gz backup in /var/spool/koha/instance/ and verify logs are in there
2. apply this patch
3. this time do sudo koha-dump --exclude-logs and sudo koha-run-backups --exclude-logs and check the contents of the .tar.gz backup in /var/spool/koha/instance and verify nothing from /var/log/koha is in there.

 Current status: ASSIGNED
Comment 2 Danyon Sewell 2024-03-15 01:27:22 UTC
Created attachment 163158 [details] [review]
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs

Written patch to add flag to both koha-dump and koha-run-backups.

Test plan:
1. do a sudo koha-dump and sudo koha-run-backups and check the contents of the .tar.gz backup in /var/spool/koha/instance/ and verify logs are in there
2. apply this patch
3. this time do sudo koha-dump --exclude-logs and sudo koha-run-backups --exclude-logs and check the contents of the .tar.gz backup in /var/spool/koha/instance and verify nothing from /var/log/koha is in there.
Comment 3 David Nind 2024-03-23 08:05:13 UTC
Created attachment 163754 [details] [review]
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs

Written patch to add flag to both koha-dump and koha-run-backups.

Test plan:
1. do a sudo koha-dump and sudo koha-run-backups and check the contents of the .tar.gz backup in /var/spool/koha/instance/ and verify logs are in there
2. apply this patch
3. this time do sudo koha-dump --exclude-logs and sudo koha-run-backups --exclude-logs and check the contents of the .tar.gz backup in /var/spool/koha/instance and verify nothing from /var/log/koha is in there.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2024-03-23 08:08:08 UTC
Testing notes (using koha-testing-docker):

1. To extract the files to check for the logs (note: name of file will be different): sudo tar -zxvf /var/spool/koha/kohadev/kohadev-2024-03-23.tar.gz

2. After applying the patch, run a reset_all (so that the new option for the commands are picked up).
Comment 5 Danyon Sewell 2024-03-24 22:30:44 UTC
Created attachment 163760 [details] [review]
Bug 36325: Add --exclude-logs option to koha-run-backups
Comment 6 Kyle M Hall 2024-05-10 15:39:59 UTC
Created attachment 166583 [details] [review]
Bug 36325: Add option to koha-run-backups/koha-dump, to exclude logs

Written patch to add flag to both koha-dump and koha-run-backups.

Test plan:
1. do a sudo koha-dump and sudo koha-run-backups and check the contents of the .tar.gz backup in /var/spool/koha/instance/ and verify logs are in there
2. apply this patch
3. this time do sudo koha-dump --exclude-logs and sudo koha-run-backups --exclude-logs and check the contents of the .tar.gz backup in /var/spool/koha/instance and verify nothing from /var/log/koha is in there.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 7 Kyle M Hall 2024-05-10 15:41:01 UTC
Created attachment 166584 [details] [review]
Bug 36325: Add --exclude-logs option to koha-run-backups

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 8 Katrin Fischer 2024-05-13 12:02:23 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-05-29 12:13:34 UTC
+        if [ "$exclude_logs" = "yes" ]; then
+        tar -czf "$metadump" -C / $excludes \
...
+        else
         tar -czf "$metadump" -C / $excludes \

Is the folding correct ?