[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:32:53 CET 2023


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

Andreas Jonsson <andreas.jonsson at kreablo.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andreas.jonsson at kreablo.se

--- Comment #3 from Andreas Jonsson <andreas.jonsson at kreablo.se> ---
I do not understand why it is validated that a complete pair of sql.gz and
tar.gz exists before deleting the pair.  As if it would be especially desirable
to preserve backups that may have failed before being completed indefinitely. 
I suggest that we don't do this.

We can select files for deletion with the `find' command.  We can use the
modification time instead of the date in the filename.  These should normally
be the same.

We can also use a stricter pattern for matching files to avoid deleting files
that have not been created by the backup script.  For instance:

find $backupdir -maxdepth 1 \( -mtime +$days -or -mtime $days \) \
                -name $name-'[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].???'.gz
\
                \( -name \*.sql.gz -or -name \*.tar.gz \) -print0 | xargs -0 -r
rm

-- 
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