Bugzilla – Attachment 171179 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: Always delete old backup files
Bug-36435-Always-delete-old-backup-files.patch (text/plain), 3.02 KB, created by
Michał
on 2024-09-09 09:08:36 UTC
(
hide
)
Description:
Bug 36435: Always delete old backup files
Filename:
MIME Type:
Creator:
Michał
Created:
2024-09-09 09:08:36 UTC
Size:
3.02 KB
patch
obsolete
>From 4267c59f518edd9077ba321c05148e07d6e2c356 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 1 May 2024 02:21:28 +0000 >Subject: [PATCH] Bug 36435: Always delete old backup files >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Recently this step was moved inside the condition so would only run if koha-dump returned a success status. > >If a log file is being written to while koha-dump runs tar, tar returns a warning and a non-zero exit status. When this happens, koha-dump still completes but the success status condition is not true, so the old backups files are not deleted. > >There is no nice way to ignore the non-zero exit status from tar, and large libraries receive enough traffic for the tar 'file changed as we read it' warning to cause enough problems that old backup files begin to fill up the disk. > >This patch removes the koha-dump conditional. This returns the script to the behaviour before it was changed in Bug 30627. > >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> >Signed-off-by: MichaÅ Kula <148193449+mkibp@users.noreply.github.com> >--- > debian/scripts/koha-run-backups | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > >diff --git a/debian/scripts/koha-run-backups b/debian/scripts/koha-run-backups >index 91401ce6aa..2555197ca2 100755 >--- a/debian/scripts/koha-run-backups >+++ b/debian/scripts/koha-run-backups >@@ -72,15 +72,13 @@ fi > > for name in $(koha-list --enabled) > do >- if koha-dump ${exclude_indexes} ${exclude_logs} "$name" > /dev/null; then >- # Only delete old backups if dump script return success. >+ koha-dump ${exclude_indexes} ${exclude_logs} "$name" > /dev/null; > >- if [ -z "$dirname" ]; then >- backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )"; >- else >- backupdir="$dirname/$name"; >- fi >- >- find $backupdir -maxdepth 1 \( -mtime +$days -or -mtime $days \) -name $name-'[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].???'.gz \( -name \*.sql.gz -or -name \*.tar.gz \) -print0 | xargs -0 -r rm >+ if [ -z "$dirname" ]; then >+ backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )"; >+ else >+ backupdir="$dirname/$name"; > fi >+ >+ find $backupdir -maxdepth 1 \( -mtime +$days -or -mtime $days \) -name $name-'[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].???'.gz \( -name \*.sql.gz -or -name \*.tar.gz \) -print0 | xargs -0 -r rm > done >-- >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