Bug 56752 - clean_old_backups may delete ALL backups
clean_old_backups may delete ALL backups
Status: NEW
Product: UCS
Classification: Unclassified
Component: univention-lib
UCS 5.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS maintainers
UCS maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-18 17:08 CEST by Finn David
Modified: 2023-10-19 14:19 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2023101721000037
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Finn David univentionstaff 2023-10-18 17:08:53 CEST
clean_old_backups may behave differently than promised by the ucr documentation.
Referring to lines 54 to 56 in /usr/share/univention-lib/backup.sh:

if [ "$count" -ge "${backup_clean_min_backups:-10}" ]; then
  find "$backup_dir" -type f -mtime "+$max_age" -regex "$pattern" -delete >/dev/null
fi


Imagine the following scenario: No backup has been created for 30 days, e.g. because of an error in the actual backup mechanism, or simply because the system has not been switched on for 30 days. Now a backup cleanup is performed:

- If 4 or more older backups exist: No backups are deleted.
- If 5 or more existing older backups: *all* older backups are deleted instead of ($count - 5) backups.

This would not be consistent with the assumption from the UCR variable description that *always* 5 backups are preserved.