[Bug 31506] New: Add "backup days" to /etc/koha/koha-common.conf
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Bug ID: 31506 Summary: Add "backup days" to /etc/koha/koha-common.conf Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Packaging Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: mtj@kohaaloha.com koha-run-backups takes the --days argument to say how many days of backup we should keep around. The value of this is set to two in the default /etc/cron.daily/koha-common that is installed by the Debian packages. I routinely increase this value to keep more backup. One thing that can happen now is that I want to create fresh backups for all the sites on a server before doing an upgrade. So I run koha-run-backups manually, but I forget about the --days argument. Result: I loose a lot of backup! It would be nice if the default for --days could be set somewhere like /etc/koha/koha-common.conf. That way we could run koha-run-backups both from cron and manually, without the --days argument, and keep the same amount of backups either way. If --days is given as an argument, it should override the default. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Rudolf Byker <rudolfbyker@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rudolfbyker@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Robin Sheat <robin@kallisti.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Assignee|koha-bugs@lists.koha-commun |robin@kallisti.net.nz |ity.org | Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #1 from Robin Sheat <robin@kallisti.net.nz> --- Created attachment 207443 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207443&action=edit Bug 31506: add 'KEEP_BACKUP_DAYS' to koha-common defaults There was no global way to specify a number of days to keep backups around for, and the default of 2 could cause people to lose backups unintentially if they forgot to include an appropriate "--days" argument when manually running `koha-run-backups`. This adds the `KEEP_BACKUP_DAYS` variable to `/etc/defaults/koha-common`, keeping this existing default of 2. It also removes the `--days` argument from the default crontab as it's no longer necessary. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Robin Sheat <robin@kallisti.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff --- Comment #2 from Robin Sheat <robin@kallisti.net.nz> --- Test plan: 1. Using KTD, 2. Make some fake backups so we can see what's being deleted: for ago in $( seq 1 10 ); do touch -d "-$ago days" /var/spool/koha/kohadev/kohadev-$( date -d "$ago days ago" "+%Y-%m-%d" ).tar.gz; done 3. Make sure that we're using our updated defaults file: cp debian/koha-core.koha-common.default /etc/default/koha-common 4. Edit that file, and set KEEP_BACKUP_DAYS to a number such as 5 (i.e. not any default) 5. Run `debian/scripts/koha-run-backups --help` and see that the help text mentions your new default setting 6. Run `debian/scripts/koha-run-backups --exclude-indexes --exclude-logs` 7. Run `ls -ltrh /var/spool/koha/kohadev/` and note that there a 5 (or however many you specified) days worth of backups still there, not the 11 - 10 fakes plus one new - there would be if nothing were deleted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Robin Sheat <robin@kallisti.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207443|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #3 from Magnus Enger <magnus@libriotech.no> --- Created attachment 207471 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207471&action=edit Bug 31506: add 'KEEP_BACKUP_DAYS' to koha-common defaults There was no global way to specify a number of days to keep backups around for, and the default of 2 could cause people to lose backups unintentially if they forgot to include an appropriate "--days" argument when manually running `koha-run-backups`. This adds the `KEEP_BACKUP_DAYS` variable to `/etc/defaults/koha-common`, keeping this existing default of 2. It also removes the `--days` argument from the default crontab as it's no longer necessary. Signed-off-by: Magnus Enger <magnus@libriotech.no> Works as advertised. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff Assignee|robin@kallisti.net.nz |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #4 from Magnus Enger <magnus@libriotech.no> --- Created attachment 207473 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207473&action=edit Bug 31506: Followup for man page This patch updates the man page for koha-run-backups with information about the new variable in the defaults file. To test: Run these commands and look at the formatted man page: $ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \ debian/docs/koha-mysql.xml $ man -l koha-mysql.8 Make sure the description of the --days paramter is consistent with the description in the updated koha-run-backups script. Check that this test passes: $ prove -v xt/verify-debian-docbook.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #5 from Magnus Enger <magnus@libriotech.no> --- I signed off on the patch from Robin (thanks a ton!), but I also added a followup for the XML of the man page, which needs another signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 Robin Sheat <robin@kallisti.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #207473|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #6 from Robin Sheat <robin@kallisti.net.nz> --- Created attachment 207527 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207527&action=edit Bug 31506: Followup for man page This patch updates the man page for koha-run-backups with information about the new variable in the defaults file. To test: Run these commands and look at the formatted man page: $ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \ debian/docs/koha-mysql.xml $ man -l koha-mysql.8 Make sure the description of the --days paramter is consistent with the description in the updated koha-run-backups script. Check that this test passes: $ prove -v xt/verify-debian-docbook.t Signed-off-by: Robin Sheat <robin@kallisti.net.nz> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #7 from Robin Sheat <robin@kallisti.net.nz> --- While checking, I found a missing entry in the man page that seems sensible to include in this rather than creating a whole new bug for it. Also corrected the test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31506 --- Comment #8 from Robin Sheat <robin@kallisti.net.nz> --- Created attachment 207528 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=207528&action=edit Bug 31506: include --exclude-logs argument to docs Not strictly part of this bug, but makes some sense to go here, this just adds the missing --exclude-logs argument from the koha-run-backups man page. Test: 1. Run xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl-ns/manpages/docbook.xsl debian/docs/koha-run-backups.xml 2. man -l koha-run-backups.8 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org