Koha/debian
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
..
docs Bug 35713: Remove outdated debian/docs/LEEME.Debian file 2024-01-11 12:10:45 +01:00
scripts Bug 30627: Verify --days parameter and use find command to select old backups for deletion 2024-01-26 15:13:49 +01:00
source
templates Bug 25672: Convert to restricting to listed repositories only 2023-10-31 11:02:43 -03:00
bd-to-depends Bug 20019: use Modern::Perl in misc perl scripts 2018-02-05 09:47:08 -03:00
build-git-snapshot
changelog Update debian/changelog file: 22.12.00-3 2023-02-20 09:44:12 -03:00
clean Bug 32994: Remove compiled files from src (2) 2023-02-22 10:03:25 -03:00
compat Bug 18908: Warning "Compatibility levels before 9 are deprecated" 2018-03-19 13:55:47 -03:00
control Bug 25691: (follow-up) Update control file with wiki link 2024-01-16 12:06:09 +01:00
control.in Bug 25691: Replace link to non-existing README with wiki link 2024-01-16 12:06:08 +01:00
copyright
koha-common.bash-completion Bug 33108: Teach koha-list filter elasticsearch 2023-03-20 09:39:46 -03:00
koha-common.config
koha-common.cron.d Bug 17717: Make cronjobs using koha-foreach use --chdir 2018-03-15 08:22:04 +00:00
koha-common.cron.daily
koha-common.cron.hourly
koha-common.cron.monthly
koha-common.default
koha-common.dirs
koha-common.docs Bug 35713: Remove outdated debian/docs/LEEME.Debian file 2024-01-11 12:10:45 +01:00
koha-common.init
koha-common.install
koha-common.links
koha-common.logrotate
koha-common.postinst Bug 35242: Force memcache restart after koha upgrade 2023-11-03 12:04:44 -03:00
koha-common.preinst
koha-common.README.Debian
koha-common.service Bug 33371: Add [Install] section to koha-common.service 2023-06-01 11:55:28 -03:00
koha-common.templates Bug 11404: Make the install process aware of the changes 2014-05-19 21:50:54 +00:00
koha-core.bash-completion
koha-core.config Bug 26672: Add additional koha-core and koha-full files to ./debian 2020-11-25 16:18:03 +01:00
koha-core.default
koha-core.dirs
koha-core.docs Bug 35713: Remove outdated debian/docs/LEEME.Debian file 2024-01-11 12:10:45 +01:00
koha-core.init
koha-core.install
koha-core.links
koha-core.logrotate
koha-core.postinst
koha-core.preinst Bug 26672: Add additional koha-core and koha-full files to ./debian 2020-11-25 16:18:03 +01:00
koha-core.templates
koha-full.postinst
koha-post-install-setup Add koha-post-install-setup, a script to be run by sysadmin post-install. 2010-05-25 07:59:19 -04:00
koha.apache-ports Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.config Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.dirs Replace old, non-functional Debian packaging with a new one. 2010-04-16 00:41:54 -04:00
koha.install Bug 14302: Remove GRS1 specific code 2018-08-31 11:24:20 +00:00
koha.postinst Bug 25691: Replace link to non-existing README with wiki link 2024-01-16 12:06:08 +01:00
koha.postrm
koha.prerm
koha.README.Debian Bug 5550 - correct filename referenced in docs 2011-01-01 07:43:30 +13:00
list-deps Bug 29882: remove unrequired package definitions in list-deps script 2022-09-07 13:17:59 -07:00
README.build
rules Bug 33168: (follow-up) Swap spaces for tabs 2023-04-04 11:26:20 +02:00
unavailable.html
update-control Add tools to update debian/control's build dependencies. 2010-06-02 07:14:36 -04:00

In order to build .deb packages, following debian packages need to be present
(installed): 
devscripts
pbuilder
dh-make
fakeroot

As root (or sudo) execute:
pbuilder create

Executing build-git-snapshot without any arguments will leave package and the
rest in some pbuilder dir, eg. /var/cache/pbuilder/result It is highly
recommended that --buildresult option is used.