Bugzilla – Attachment 171178 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), 3.58 KB, created by
Michał
on 2024-09-09 09:07:47 UTC
(
hide
)
Description:
Bug 36435: [alternative] Catch harmless errors in koha-dump
Filename:
MIME Type:
Creator:
Michał
Created:
2024-09-09 09:07:47 UTC
Size:
3.58 KB
patch
obsolete
>From 1cd1aea40c85f9d35cf1ff5ce0ee831f2e2222d4 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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> >Co-authored-by: MichaÅ Kula <148193449+mkibp@users.noreply.github.com> >Signed-off-by: MichaÅ Kula <148193449+mkibp@users.noreply.github.com> >--- > debian/scripts/koha-dump | 45 +++++++++++++++++++++++----------------- > 1 file changed, 26 insertions(+), 19 deletions(-) > >diff --git a/debian/scripts/koha-dump b/debian/scripts/koha-dump >index f58c4b2022..6ed0f1b683 100755 >--- a/debian/scripts/koha-dump >+++ b/debian/scripts/koha-dump >@@ -124,30 +124,37 @@ dump_instance() > output="$output to $metadump" > [ "$quiet" = "no" ] && echo "$output" > >- if [ "$exclude_logs" = "yes" ]; then >- tar -czf "$metadump" -C / $excludes \ >- "etc/koha/sites/$name" \ >- "etc/apache2/sites-available/$instancefile" \ >- "etc/apache2/sites-enabled/$instancefile" \ >- "var/lib/koha/$name" \ >- $uploaded_files_dir \ >- $uploaded_temp_files_dir >+ # 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 > >- chown "root:$name-koha" "$metadump" >- chmod g+r "$metadump" >+ if [ "$exclude_logs" = "yes" ]; then >+ tar -czf "$metadump" -C / $excludes \ >+ "etc/koha/sites/$name" \ >+ "etc/apache2/sites-available/$instancefile" \ >+ "etc/apache2/sites-enabled/$instancefile" \ >+ "var/lib/koha/$name" \ >+ $uploaded_files_dir \ >+ $uploaded_temp_files_dir > else >- tar -czf "$metadump" -C / $excludes \ >- "etc/koha/sites/$name" \ >- "etc/apache2/sites-available/$instancefile" \ >- "etc/apache2/sites-enabled/$instancefile" \ >- "var/lib/koha/$name" \ >- "var/log/koha/$name" \ >- $uploaded_files_dir \ >- $uploaded_temp_files_dir >+ tar -czf "$metadump" -C / $excludes \ >+ "etc/koha/sites/$name" \ >+ "etc/apache2/sites-available/$instancefile" \ >+ "etc/apache2/sites-enabled/$instancefile" \ >+ "var/lib/koha/$name" \ >+ "var/log/koha/$name" \ >+ $uploaded_files_dir \ >+ $uploaded_temp_files_dir >+ fi >+ >+ if [ "$?" != "1" -a "$?" != "0" ]; then >+ exit $? >+ fi >+ >+ set -e > > chown "root:$name-koha" "$metadump" > chmod g+r "$metadump" >- fi > > [ "$quiet" = "no" ] && echo "Done." > fi >-- >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