Selective “force” re-sync with syncthing

To synchronize files from one of my servers to my local machine I use [syncthing][st] with the server’s folder in [“Send Only”][master] mode. Usually this works flawlessly. As files are added to the directory, syncthing copies them to my local machine without a hitch. However, sometimes it doesn’t work, and the remote files will just never show up. In this case syncthing provides the [“Override Changes”][master] button, but this is usually not what I want to do. I don’t want to re-sync all of the files from master to my local machine, I just want to sync a single file, or folders worth of files.

In this case there’s a neat little trick you can do, which is obvious in hindsight but it took me a while to think of it: just update the mtimes. SSH onto the server and run something like:

$ find /path/to/folder/to/force/sync -type f -print0 | xargs -0 -n1 touch

This will go through every file in the folder we want to sync and update its mtime (using touch) to be the current time. Once syncthing re-scans the directory, it will see these updated mtimes and push the files down.

[st]: https://syncthing.net/
[master]: https://docs.syncthing.net/users/foldertypes.html#folder-sendonly

 
33
Kudos
 
33
Kudos

Now read this

Howto: Gargle Authentication in Jupyter

TL;DR: See the code snippet at the bottom of this post for the code needed to get this to work. gargle is a great little library for the R programming language that implements several authentication mechanisms against Google accounts. It... Continue →