Bugzilla – Attachment 106829 Details for
Bug 21111
Add --exclude-indexes option to koha-run-backups
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21111: Add --exclude_indexes to koha-run-backups
Bug-21111-Add---excludeindexes-to-koha-run-backups.patch (text/plain), 3.08 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-07-13 13:29:51 UTC
(
hide
)
Description:
Bug 21111: Add --exclude_indexes to koha-run-backups
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-07-13 13:29:51 UTC
Size:
3.08 KB
patch
obsolete
>From b9c35567730763531de67edee35714e74beb2c6e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 13 Jul 2020 10:25:02 -0300 >Subject: [PATCH] Bug 21111: Add --exclude_indexes to koha-run-backups > >This patch adds a trivial switch so koha-run-backups can pass the >--exclude_indexes option switch to koha-dump. This way if the sysadmin >doesn't want to backup the Zebra indexes, it can be controlled by >tweaking the cron definition. > >To test: >1. Apply this patch >2. Run: > $ debian/scripts/koha-run-backups --days 2 --output /var/spool/koha >3. Notice the size of the backups: > $ ls -lh /var/spool/koha/kohadev >4. Try the new option switch: > $ debian/scripts/koha-run-backups \ > --exclude_indexes \ > --days 2 --output /var/spool/koha >5. Repeat 3 >=> SUCCESS: Backups are smaller! >6. Sign off :-D >--- > debian/docs/koha-run-backups.xml | 7 +++++++ > debian/scripts/koha-run-backups | 13 ++++++++----- > 2 files changed, 15 insertions(+), 5 deletions(-) > >diff --git a/debian/docs/koha-run-backups.xml b/debian/docs/koha-run-backups.xml >index 653a611a4ff..2ac4a5d9e57 100644 >--- a/debian/docs/koha-run-backups.xml >+++ b/debian/docs/koha-run-backups.xml >@@ -46,6 +46,13 @@ > </listitem> > </varlistentry> > >+ <varlistentry> >+ <term><option>--exclude_indexes</option></term> >+ <listitem> >+ <para>Exclude Zebra indexes from the backups (default: false).</para> >+ </listitem> >+ </varlistentry> >+ > </variablelist> > </refsect1> > >diff --git a/debian/scripts/koha-run-backups b/debian/scripts/koha-run-backups >index 74f879b7442..2c2d25a9a2a 100755 >--- a/debian/scripts/koha-run-backups >+++ b/debian/scripts/koha-run-backups >@@ -28,10 +28,11 @@ This allows automation of backing up the koha data and configuration to the > filesystem. It will keep the past so many backups, discarding older ones. > > Options: >- --output: the directory that the resulting files will be placed into. >- (default: /var/spool/koha) >- --days: the number of days to keep backups around for >- (default: 2) >+ --output /path The directory that the resulting files will be placed into. >+ (default: /var/spool/koha) >+ --days 2 The number of days to keep backups around for >+ (default: 2) >+ --exclude_indexes Exclude Zebra indexes from the backups (default: false) > > Note: backups produced using this tool can be restored using \`koha-restore'. > EOH >@@ -50,6 +51,8 @@ while true ; do > days=$2; shift 2 ;; > --output) > dirname=$2; shift 2 ;; >+ --exclude-indexes) >+ exclude_indexes="--exclude_indexes"; shift ;; > --) shift ; break ;; > *) echo "Unknown error parsing the command line!" ; exit 1 ;; > esac >@@ -57,7 +60,7 @@ done > > for name in $(koha-list --enabled | grep -Fxv demo) > do >- koha-dump "$name" > /dev/null >+ koha-dump ${exclude_indexes} "$name" > /dev/null > if [ -z "$dirname" ]; then > backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )"; > else >-- >2.27.0
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 21111
:
106829
|
106830
|
106835
|
111641
|
111680
|
111746
|
112982