File Versioning locally

If you could give an additional option to do file versioning on the local machine when a user deletes or changes a local file, it would allow Syncthing to be used as a local backup/versioning software (a whole new use), which may be immensely useful to a large number of users.

At present, if I delete/change a file on my local machine, only the remote machine that is syncing will save the versions. If you have this optional switch, the local machine would also save a version of the same file in .stversions folder (or another one).

Here’s a typical use case:

I have a desktop PC for CAD/video (high power apps) and a typical laptop for portability use. Some people have two computers - one home and one work.

I keep data synced between the two. However, if I don’t turn on my laptop for weeks, there is no versioning happening on my desktop PC, which makes me want to install another versioning software.

Thank you for creating this wonderful software and making it available to all for free. It is deeply appreciated.

1 Like

There is certainly a case for local file versions, many OS:es offer this somehow out of the box (Windows shadow copies etc). But it’s not really part of file syncing and it’s difficult to do correctly in an external application so I feel this is out of scope for Syncthing.

I think there are two ways to solve you problem or ideally you combine both.

– Use a always on server. This is very convenient because no matter where and when - you can always get your data in sync. For example your laptop has not been online for a while. You grab it, head out and just need an internet connection to get back in sync, because the server is always up to date.

-Use dedicated backup software. Here you get all the advantages (like versioning) to back up remotely or locally. I can recommend https://restic.net/, I think completes syncthing rather well.

(I have a always on server with syncthing that regularly backups for me.)

I second this feature request. I actually though that syncthing had me covered, when I realized this morning that it actually doesn’t do local file staggering. I understand that there is other software for this too, but it would be a nice option.

It’s simply not possible.

At the point you see a file deleted it’s already deleted, you can’t version it if its gone.

There are some technical solutions. We’re watching files for changes, so we can make a copy every time a file changes and already have it archived. I’m saying this because it’s the obvious response to your concern.

However we should not do this because 1) it would suck as we’d be in a race against user actions and we’d lose, 2) this is not what we are about, 3) there are good solutions for this already, properly implemented at the file system level.

So, no, again.

Just an idea: Would it be possible to sync the content of the stversions folder amongst sync partners?

A deletes file x1
A syncs delete to B
B moves x1 to stversions
B syncs stversions/X1 back to A

So versioning would become part of the synced share.

stversions is just a directory, you are free to add it as a syncthing folder and share it among your devices.

I wasn’t aware you could do that. That’s interesting, I will try it out sometime. Could lead to nasty feedback loops if you started deleting files in stversions though.

Keeping backup and versioning separate from syncing is still the sensible thing to do though.

Not really, as these are independant entities. New versions or version deletions does not mean new files in the parent folder.

Innovative idea! However, it wouldn’t solve the problem described in my first post in this thread. So at present, I am keeping both computers ON – my laptop and my desktop so that one of them keeps the file versioning while I work on the other. My goal was to not have to keep both of them on at the same time just for the purpose of file versioning.

Windows Shadow copies is not as elegant and powerful as the versioning you guys have implemented. With Trash Can, Simple and Staggered versioning, the user has the wonderful ability to use one or the other, for each different folder structure depending on how critical data it holds. The Staggering File Versioning is just amazingly implemented!

Thank you