Koha/debian/scripts
Andreas Jonsson c5a941f44f Bug 30627: Verify --days parameter and use find command to select old backups for deletion
Test plan

* Create some old fake backups:

backuproot=/var/spool/koha
instance=kohadev

backupdir="$backuproot"/"$instance"

for i in 1 2 3 4 ; do
   for j in sql tar xxx ; do
      file="$backupdir"/"$instance"-$(date -I -d "- $i day").${j}.gz
      if ! test -e "$file" ; then
         touch -t "$(date +%Y%m%d%H%M -d "- $i day")" "$file"
      fi
   done
done

* Verify that --days parameter is validated

sudo koha-run-backups --days 0
sudo koha-run-backups --days foo

* Run backup

sudo koha-run-backups --days 3

* Verify that backups from 3 days have been preserved and older backups have been deleted
* Verify that filenames that do not match the pattern (the .xxx.gz files) are preserved

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit b2e5efbdae)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cadf36dc5f)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-02-08 18:56:19 +00:00
..
koha-create Bug 34204: Fix koha-shell under debian 12 2023-10-24 21:31:49 -10:00
koha-create-dirs
koha-disable
koha-dump
koha-dump-defaults
koha-elasticsearch
koha-email-disable
koha-email-enable
koha-enable
koha-es-indexer
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 09:28:42 -10:00
koha-functions.sh
koha-indexer
koha-list Bug 33108: Teach koha-list filter elasticsearch 2023-03-20 09:39:46 -03:00
koha-mysql
koha-mysqlcheck
koha-passwd Bug 28493: Make koha-passwd display the username 2023-08-07 20:05:46 -10:00
koha-plack
koha-rebuild-zebra
koha-remove Bug 33108: Make init handle koha-es-indexer 2023-03-20 09:39:47 -03:00
koha-reset-passwd
koha-restore
koha-run-backups Bug 30627: Verify --days parameter and use find command to select old backups for deletion 2024-02-08 18:56:19 +00:00
koha-shell
koha-sip
koha-sitemap
koha-translate
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker
koha-z3950-responder
koha-zebra