How to properly config archive

Hello and thank you for this brilliant tool.

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 = *;*;*;*
second:
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 ?)
third:
Archive every = 1 week (? maybe better 1h ?)
Archive for = 2 months
Archive window = *;*;*;7
fourth:
Archive every = 1 month (? maybe better 1h ?)
Archive for = 2 years
Archive window = *;1;*;*
fifth
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.

Hi fpdragon

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.

urclean.sql.txt (4.6 KB)

I’d just set the interval to 1h, then change the minimal amount of backups to be kept to 2*24=48 to keep at least 2 days of hourly backups around.

Set “every” to a little bit less then 1 day (e.g. 23h), otherwise it may miss windows.

Dito here, 6 days instead of 1 week.

27 days

I’d just set it to 300 days or something.

What are you expecting and what are you getting?

Thank you. Cool solution.

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

And also thanks to you uroni. I thought that this “archive every” could be a problem and I have to reduce this value. Thank you for your confimation.

Just for info.

I build a small C# application that manipulates the SQLite database on my Windows 10 UrBackup Server. So far it works perfectly fine and I was able to implement exactly my preferred backup strategy.

Thank you very much for sharing your solution.

@fpdragon maybe you could post it here so other people can use it ?

UrBackup_Cleaner.zip (6.2 KB)

Ok, I try it again…
Source Files + Project Files

But you have to download or NuGet the missing packages
e.g. System.Data.SQLite …

Can’t upload the whole project because of the upload limit… -_-

And please keep in mind that this is just a small tool for my needs and it’s not very clean… :stuck_out_tongue_winking_eye: