Koha/debian/scripts
Andreas Jonsson b2e5efbdae
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>
2024-01-26 15:13:49 +01:00
..
koha-create Bug 34204: Fix koha-shell under debian 12 2023-10-18 15:41:22 -03:00
koha-create-dirs
koha-disable
koha-dump
koha-dump-defaults
koha-elasticsearch
koha-email-disable
koha-email-enable
koha-enable
koha-es-indexer Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
koha-foreach Bug 34653: Make koha-foreach return the correct status code 2023-09-25 10:56:40 -03:00
koha-functions.sh Bug 33108: koha-es-indexer added 2023-03-20 09:39:45 -03:00
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-07-19 13:00:41 -03: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-01-26 15:13:49 +01:00
koha-shell
koha-sip
koha-sitemap
koha-translate
koha-upgrade-schema
koha-upgrade-to-3.4
koha-worker
koha-z3950-responder
koha-zebra