From 0737260ef895bad2f274194159feec38bfb9abbb Mon Sep 17 00:00:00 2001 From: danyonsewell Date: Thu, 14 Mar 2024 02:06:05 +0000 Subject: [PATCH] Bug 36311: Add option to koha-run-backups, to only include database dump Test plan: 1. Dry run koha-run-backups, to verify that both the .sql.gz and .tar.gz backups are included 2. Apply this patch 3. Run the script again, this time with the --schema-only flag 4. check /var/spool/koha/kohadev/ to see that only .sql.gz file has been included. --- debian/scripts/koha-run-backups | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/scripts/koha-run-backups b/debian/scripts/koha-run-backups index a9223844fe3..db778ac56c9 100755 --- a/debian/scripts/koha-run-backups +++ b/debian/scripts/koha-run-backups @@ -39,8 +39,9 @@ EOH } exclude_indexes="" +schema_only="" -CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes -n 'koha-run-backups' -- "$@"` +CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes,schema-only -n 'koha-run-backups' -- "$@"` if [ $? != 0 ] ; then show_help ; exit 1 ; fi @@ -55,6 +56,8 @@ while true ; do dirname=$2; shift 2 ;; --exclude-indexes) exclude_indexes='--exclude-indexes'; shift ;; + --schema-only) + schema_only='--schema-only'; shift ;; --) shift ; break ;; *) echo "Unknown error parsing the command line!" ; exit 1 ;; esac @@ -67,7 +70,7 @@ fi for name in $(koha-list --enabled | grep -Fxv demo) do - if koha-dump ${exclude_indexes} "$name" > /dev/null; then + if koha-dump ${exclude_indexes} ${schema_only} "$name" > /dev/null; then # Only delete old backups if dump script return success. if [ -z "$dirname" ]; then -- 2.30.2