Bugzilla – Attachment 165943 Details for
Bug 36435
Prevent warnings from interrupting koha-run-backups when deleting old backup files
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36435: [alternative] Catch harmless errors in koha-dump
Bug-36435-alternative-Catch-harmless-errors-in-koh.patch (text/plain), 1.96 KB, created by
David Nind
on 2024-05-01 07:23:21 UTC
(
hide
)
Description:
Bug 36435: [alternative] Catch harmless errors in koha-dump
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-05-01 07:23:21 UTC
Size:
1.96 KB
patch
obsolete
>From af1cbcbe7188b8d05827ad434e9b3dbbdcc2dbc3 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 1 May 2024 02:18:19 +0000 >Subject: [PATCH] Bug 36435: [alternative] Catch harmless errors in koha-dump > >tar has exit status 1 if any file has changed while being read, which is likely to happen as the logfiles are included. this patch will catch these harmless errors so that koha-dump will still return a success code. > >Test plan: >1. Create a number of backups and edit their modify time to being older than 2 days >2. run the koha-run-backups script and try and write to one of the files it includes while it's being backed up (you'll trigger a warning from tar saying the file changed as it was being read) >3. verify that the older backups are not being cleaned up and deleted despite new backups being made. >4. Apply this patch >5. Complete steps 1-2 again and then go and look to see if the older backups are being deleted. > >Sponsored-by: Catalyst IT >Signed-off-by: David Nind <david@davidnind.com> >--- > debian/scripts/koha-dump | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/debian/scripts/koha-dump b/debian/scripts/koha-dump >index d994607300..50af5888ed 100755 >--- a/debian/scripts/koha-dump >+++ b/debian/scripts/koha-dump >@@ -123,6 +123,10 @@ dump_instance() > output="$output to $metadump" > [ "$quiet" = "no" ] && echo "$output" > >+ # tar has exit status 1 if any file has changed while being read, >+ # which is likely to happen as the logfiles are included. >+ set +e >+ > tar -czf "$metadump" -C / $excludes \ > "etc/koha/sites/$name" \ > "etc/apache2/sites-available/$instancefile" \ >@@ -132,6 +136,12 @@ dump_instance() > $uploaded_files_dir \ > $uploaded_temp_files_dir > >+ if [ "$?" != "1" -a "$?" != "0" ]; then >+ exit $? >+ fi >+ >+ set -e >+ > chown "root:$name-koha" "$metadump" > chmod g+r "$metadump" > >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36435
:
163970
|
164240
|
164491
|
165936
|
165937
|
165943
|
165944
|
171178
|
171179
|
172133
|
172528