[Koha-bugs] [Bug 30627] koha-run-backups delete the backup files after finished its job without caring days option

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Nov 6 15:34:59 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30627

--- Comment #4 from Andreas Jonsson <andreas.jonsson at kreablo.se> ---
Created attachment 158533
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=158533&action=edit
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

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list