cannot adjust cleanup interval in staggered file versioning

hi,

I’m looking to keep all older versions, for an indefinite amount of time. So I don’t want to run cleanup. But no matter how many times I set cleanup to interval to 0, it’s replaced with the default value of 3600.

I’m on 1.12.0 ubuntu 20.04.1

any suggestions would be appreciated.

thanks !

sam

The cleanup interval doesn’t directly set how long the files are kept, just how often we check for files that need cleaning up. So make sure you set the other interval like things to something that keeps your files for a very long time.

I don’t see a specific reason that the zero value for the cleanup interval wouldn’t be respected, but it also looks like a negative value should mean “never” so perhaps try that.

That’s another case of inconsistent default handling: In folder.go zero is interpreted as disabled, in GUI zero gets replaced with 3600 (default): https://github.com/syncthing/syncthing/pull/7234

2 Likes

Thanks for the replies and the commit. When would this make it into a wide release ?

I’ve set the other interval to zero, but from what I understand, even the first interval set at zero, the interval system applies, so that for example if there are three rapid changes to a file (>30s), then no more, after a day I will only have the most recent version from the hour ?

(whereas what I’m aiming for is having all three versions)

From what I understand, the cleanup is when this pruning is done ? (which is why I’m trying to disable the cleanup.)

I tried a negative value in the GUI, but the it told me only positive values were allowed.

I will look to see if there is config file where I could set this manually.

For reference, this is basically a workaround for achieving one-way write-once sync. (I read that implementing this explicitely is out of scope).

It will be in v1.13.0, so RC early next month, stable early February (https://docs.syncthing.net/users/releases.html#schedule).

You don’t need to. If you set it to 0, that will be applied. The bug manifests when you open the folder edit dialog again: There the correct value of 0 will get translated to 3600 on opening.

Additionally as @calmh already wrote: This is not the main parameter to change to keep files forever, but staggeredMaxAge is. When staggeredMaxAge is 0, files will be kept forever regardless of cleanoutIntervalS.

Thanks for your reply.

I did find the value in the config file, and though I had set to zero in the GUI, the value in the config file was 3600 (for each of the folders I had set to zero in the GUI).

I set the values to zero manually (as my normal user) in the config file, and when I came back a bit later, the values in the config file were 3600 again.

If staggeredMaxAge lets you keep files forever, regardless of cleanoutIntervals, I suggest the documentation be amended to clarify that.

I may not have read it attentively enough, but my understanding was :

-> cleanoutIntervals are applied as indicated. Therefore you get, for example, the most recent version per hour, one day later. They are applied up until 1 version per week

-> staggeredMaxAge then determines how many 1 week versions you’re keeping. (so for example 2 years, you’d keep 52*2 versions.

thanks & all best,

sam

Frankly I’m not sure what behavior you’re even trying to accomplish.

The staggered versioner works by creating lots of frequent versions to begin with, then thinning them to a set of intervals you configure, in the end keeping the “one per week” versions for as long as you request.

The staggered versioner also runs this cleanup on each archive operation (every time it archives a file), so changing or disabling the periodic cleanup has negligible or at least surprising effects.

If you were to successfully disable the periodic cleaning you would revert the “staggered” mechanism to being just the “simple” mechanism with infinitely many allowed versions. Is that what you’re looking for?

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.