Univention Bugzilla – Bug 56752
clean_old_backups may delete ALL backups
Last modified: 2023-10-19 14:19:48 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.