Staggered File Versioning how does this work?

I edited photographs some are psd files, what i would like is Syncthing to sync the new edited file and keep a older version or if i delete a file by accident that the file not get removed from the sync location.

I tested Staggered File Versioning by creating a text file, it got synced then i added some text after that got synced i deleted the file and i only have the empty text file that i created before how do i get Syncthing to keep deleted files? for X time.

Staggered File Versioning does not work it will only save 1 version and that’s it wont even save a deleted file version

if i don’t make any changes to a file and then delete it then it will keep a copy in the .stversions so looks like Staggered file versioning makes 1 version in the .stversions folder and that’s it wont save a deleted version or any newer versions

“1 Hour For the first hour, the most recent version is kept every 30 seconds. 1 Day For the first day, the most recent version is kept every hour. 30 Days For the first 30 days, the most recent version is kept every day. ”

that’s clearly not working, i edited the file many times in the last 10min still the only copy in the .stversions folder is the original file.

anyone know how i can fix this>?

I suggest you run with STTRACE=versioner and see what the debug output is, perhaps it will give some clues. I am not sure how widely that’s exercised to tell you if it’s broken or not.

2015-08-12 14:13:19,882 INFO success: syncthing entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2015-08-12 14:14:12,718 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:14:12.717794 staggered.go:240: DEBUG: Waiting for lock on /syncfolders/eewwe/.stversions

2015-08-12 14:14:12,718 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:14:12.717920 staggered.go:248: DEBUG: not archiving nonexistent file /syncfolders/eewwe/333.txt

2015-08-12 14:14:54,422 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:14:54.422151 staggered.go:240: DEBUG: Waiting for lock on /syncfolders/eewwe/.stversions

2015-08-12 14:14:54,422 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:14:54.422293 staggered.go:268: DEBUG: archiving /syncfolders/eewwe/333.txt [YNQIN] 2015/08/12 14:14:54.422316 staggered.go:286: DEBUG: moving to /syncfolders/eewwe/.stversions/333~20150812-141454.txt

2015-08-12 14:14:54,423 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:14:54.423692 staggered.go:169: DEBUG: Versioner: Expiring versions [/syncfolders/eewwe/.stversions/333~20150812-141454.txt]

2015-08-12 14:15:28,334 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:15:28.334382 staggered.go:240: DEBUG: Waiting for lock on /syncfolders/eewwe/.stversions

2015-08-12 14:15:28,335 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:15:28.334547 staggered.go:268: DEBUG: archiving /syncfolders/eewwe/333.txt [YNQIN] 2015/08/12 14:15:28.334597 staggered.go:286: DEBUG: moving to /syncfolders/eewwe/.stversions/333~20150812-141528.txt

2015-08-12 14:15:28,335 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:15:28.335680 staggered.go:169: DEBUG: Versioner: Expiring versions [/syncfolders/eewwe/.stversions/333~20150812-141454.txt /syncfolders/eewwe/.stversions/333~20150812-141528.txt]

2015-08-12 14:15:28,336 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:15:28.335929 staggered.go:223: DEBUG: too many files in step -> delete /syncfolders/eewwe/.stversions/333~20150812-141528.txt

2015-08-12 14:16:43,927 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:16:43.927619 staggered.go:240: DEBUG: Waiting for lock on /syncfolders/eewwe/.stversions

2015-08-12 14:16:43,928 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:16:43.927784 staggered.go:268: DEBUG: archiving /syncfolders/eewwe/333.txt [YNQIN] 2015/08/12 14:16:43.927802 staggered.go:286: DEBUG: moving to /syncfolders/eewwe/.stversions/333~20150812-141643.txt

2015-08-12 14:16:43,929 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:16:43.929086 staggered.go:169: DEBUG: Versioner: Expiring versions [/syncfolders/eewwe/.stversions/333~20150812-141454.txt /syncfolders/eewwe/.stversions/333~20150812-141643.txt]

2015-08-12 14:16:43,929 DEBG ‘syncthing’ stdout output: [YNQIN] 2015/08/12 14:16:43.929338 staggered.go:223: DEBUG: too many files in step -> delete /syncfolders/eewwe/.stversions/333~20150812-141643.txt

this first “[YNQIN] 2015/08/12 14:14:54.422316 staggered.go:286: DEBUG: moving to /syncfolders/eewwe/.stversions/333~20150812-141454.txt”

worked but after that you can see the software wants to archive new version and the deleted version BUT it does not

I would like to add that I also noticed this behavior. I have noticed this issue across several shares across 3-4 computers (running different OS and architectures: Mac, Linux 64bit, Linux 32bit, windows 7). The sync itself works fine but the versions are not saved as indicated in the GUI. Specially these two cases:

for the first hour a version is kept every 30 seconds, for the first day a version is kept every hour

Is Staggered File Versioning something which is being retired and not tested well? It is definitely an attractive versioning idea.

this has been fixed :slight_smile: Unit test staggered versioning · Issue #2165 · syncthing/syncthing · GitHub we just have to wait for a new version

1 Like