koha-dump implements the --exclude-indexes option, and koha-run-backups should inherit it so it is of more use.
Created attachment 106829 [details] [review] 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
Created attachment 106830 [details] [review] 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
Created attachment 106835 [details] [review] 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
Hi Tomás. After applying the patch I get these errors: - re-running step 2: root@kohadevbox:koha(bz21111)$ debian/scripts/koha-run-backups --days 2 --output /var/spool/koha Error: Invalid instance name indexes - running step 4: root@kohadevbox:koha(bz21111)$ debian/scripts/koha-run-backups --exclude-indexes --days 2 --output /var/spool/koha koha-run-backups: unrecognized option '--exclude-indexes' debian/scripts/koha-run-backups - performs backups of the koha installations on the system 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 /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'.
Created attachment 111641 [details] [review] 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
(In reply to David Nind from comment #4) > Hi Tomás. > > After applying the patch I get these errors: Thanks for testing it! I've already submitted a fixed version.
Created attachment 111680 [details] [review] 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 Signed-off-by: David Nind <david@davidnind.com>
> Thanks for testing it! I've already submitted a fixed version. Thanks Tomás! FYI - Here are my results: Without --exclude-indexes: -rw-r----- 1 root kohadev-koha 998883 Oct 15 07:25 kohadev-2020-10-15.sql.gz -rw------- 1 root root 3958411 Oct 15 07:25 kohadev-2020-10-15.tar.gz Using --exclude-indexes: -rw-r----- 1 root kohadev-koha 998883 Oct 15 07:26 kohadev-2020-10-15.sql.gz -rw------- 1 root root 15536 Oct 15 07:26 kohadev-2020-10-15.tar.gz
Created attachment 111746 [details] [review] 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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 112982 [details] [review] 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 Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> JD amended patch: fix --exclude_indexes vs --exclude-indexes in koha-run-backups.xml
Pushed to master for 20.11, thanks to everybody involved!
enhancement will not be backported to 20.05.x