I am fighting in implementing my backup removal strategy. I noticed that there is this “Archive” functionality that can be configured somehow in the settings. So backups that are marked as archived shouldn’t be removed, as I understood.
I also found the Setting “Global soft filesystem quota” which is an mechansim to use the specified percentage before even start removing backups.
Maybe someone could help me configuring the following scenario:
I want file backups to be made every hour (incremental).
The first two days every hourly backup should be kept.
The first two weeks one backup for every day should be kept.
The first two month one backup per week shall be kept.
The first two years one backup per month shall be kept.
And if backups are older I want to keep one per year.
So the first step would be to configure under “General” “Archive” new entries.
I guess I can define multiple entries for the same backup and all archive settings are applied as a logical or?!
So my first try would be:
Archive every = 1 hour
Archive for = 2 Days
Archive window = *;*;*;*
Archive every = 1 day (? maybe it is also possible to recalculate on a hourly level ?)
Archive for = 2 Weeks
Archive window = 2;*;*;* (? keeps the 2:00-3:00h backup of every day ?)
Archive every = 1 week (? maybe better 1h ?)
Archive for = 2 months
Archive window = *;*;*;7
Archive every = 1 month (? maybe better 1h ?)
Archive for = 2 years
Archive window = *;1;*;*
Archive every = 1 year (? 1h ?)
Archve for = forever
Archive window = *;*;1;*
Please correct my config.
And also I configured “Global soft filesystem quota” to 0% to force deleting non archived backups.
What I see is that the small clock beside the archive checkboxes has unexpected value. maybe some can help. Thank you.
I was thinking of similar retention policy. I didn’t care about more than a year of backup. I found implementing weekly backup retention to be a little bit involved in generally - specially if you are dealing with missed backups, etc. So I tried to implement the following
retain intraday backups for two days
retain daily backup for two months (60 days)
retain monthly backups for a year
remove all backups after a year
My solution is based on a database hack - marking backups for deletion directly on the database and let the nightly cleaner do the cleaning. So, no archiving and deletion policy is set on the setting.
to use it (in linux) download and save the attached sql statements file (urclean.sql) and save it in you backup server. From the directory where you saved the urclean.sql file run
sqlite3 /var/urbackup/backup_server.db <urclean.sql.txt
Please backup the /var/urbackup/backup_server.db database before you run the above command so you can restore it if you don’t like what you see after running the command.
You can check which backups are marked for deletion from the web interface.
DISCLAIMER: the sql file and the procedures outlined on how to use it are provided in the hope of being useful. However, neither I nor any one else[urclean.sql.txt|attachment] is responsible for any loss or damage as a result of its use.
I also was thinking of taking over control and manipulating the UrBackup web frontend with selenium or something similar. but your solution with directly manipulating the database is far more elegant. Maybe I will try something similar but windows and c++/c# is more of my world than linux