]> git.koha-community.org Git - koha.git/commit
Bug 30627: Verify --days parameter and use find command to select old backups for...
authorAndreas Jonsson <andreas.jonsson@kreablo.se>
Mon, 6 Nov 2023 14:18:42 +0000 (15:18 +0100)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 26 Jan 2024 14:13:49 +0000 (15:13 +0100)
commitb2e5efbdae0d607f6264235ca82d884b95c1a9ef
tree79d96431f0eed1c38e7f4d5a5d62b58cfd89b7cd
parent6341d520ac0a09baa5b005abb3d8d81273a6e310
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>
debian/scripts/koha-run-backups