Can syncthing be used for full syncs only?

Hey this looks fun alternative for bittorrent sync!

Can I share code between my local computer and production server in a way that only full syncs are enabled? Partial syncs would break the system and I don’t want that.

This might be really wrong way to do it but it sounded like a good idea for me.

What do you mean by full vs partial sync?

I guess you want to only let the production server access the directory once it is in sync with his local machine. To do this you need a few things:

  1. A symlink on your production machine that points to a directory.
  2. Syncthing configured to sync to directory.N
  3. Once the sync has finished, shut down syncthing, then update the symlink to point to directory.N
  4. Now reconfigure syncthing to point to directory.N+1 and continue as before.

@jpjp Yeah exactly. It would be superb to have ability to download changes into some sort of cache. For example when downloading torrents you can usually specify to move the files to another directory when download is complete. It’s a bit different than this since it would be good to also reflect changes in server back to local computer.

Well I actually have no idea how the internals work at this point but this could be implemented for example with internal git-like version control.

.syncthing (hidden folder) /version-000002 (version in use) /version-000003 (changes from remote. MD5 hash of files doesn’t match yet so we know it isn’t fully synced)

When md5 check matches syncthing can checkout changes from version 000003.

And now we would have version control of files as well. It would open doors to use syncthing in controlled distributed continuous integration of filesystems.

Syncthing does atomic commits per file. There is no concept of a snapshot of an entire repo. I suspect it would be kind of tricky to implement as well; we’d need to know when would a good time to take such a snapshot on the source, and the sync would fail if anything changed on the source while we are still syncing.

You could also create imagefiles of some sort (%timestamp%.iso for example) periodically and put them into your repository. Once the file is on the other side it’s “complete”. In a nx setup it is easy to mount them and they behave just like read only directories, but I am sure one can do some magic on windows as well. That saves you the trouble of checking whether syncthing is in sync, shutting it down, etc.

You could also listen for events and as soon as a repo enters “Idle” state, it’s fully synced by some definition.