I have a question regarding the following configuration:
I want to have all my photos on the smartphone (android) to be copied to a server for backup in such a way that I can safely delete them on smartphone (to clean up space) and keep everything on the server.
In other words, have a one-way sync of new files from smartphone to server, do not sync deleted files (if I delete from smartphone - do not delete on the server and vice versa).
Currently not, see https://github.com/syncthing/syncthing/issues/62
tldr; Syncthing focuses on synchronizing folders and does not function as a backup service. However, in the future there might be something as a ābackupā flag.
For one way sync without deletes, you basically want a periodic rsync; Iām sure there are tools out there that do this? Itās a much simpler problem to solve than what syncthing does by default.
Iāve read the discussion you have for issue 62 and see where the challenge is.
Itās a great tool (using it for my devices) and hope that one day you will add this feature. Thank you!
P.S.
Will check rsync, didnāt try it for a while.
I used foldersync before btsync/syncthing to sync all my files between my homeserver and my Androids. I still use it for instant sync of DCIM when on mobile data.
It can sync one way without deletion.
It supports FTP,SFTP,Webdav,Owncloud,SMB (Windows Shares) and other server types.
The free version can be used with one server (but multiple folders).
I have a folder share like that. The only draw back is that ST suffixes them with delete dates because I have versioning enabled.
Set up a share, enable versioning on the end device and delete pictures from your phone. The photos will be versioned in the dot folder in the share folder on the pc.
Also v11 supposedly comes with a custom versioning option where removing is handled by scripts, that way you can move the stuff via a script but I have not tried it yet.
As a workaround to that (getting files renamed), the āexternalā versioning scheme could be used. I havenāt actually tried it myself, but a script similar to this may work on Unixes at least:
#!/bin/sh
ARCHIVEDIR=/some/place/for/old/files
FOLDERPATH="$1" # this is the path to the folder
FILEPATH="$2" # this is the filename within the folder, that is going to be overwritten
FILEDIR="${FILEPATH%/*}"
mkdir -p "$ARCHIVEDIR/$FILEDIR"
mv "$FOLDERPATH/$FILEPATH" "$ARCHIVEDIR/$FILEPATH"
I just typed that into the forum right now, so itās probably full of errors and will erase your files, but it may give someone an idea in the right direction.
On Windows thereās probably some sort of powershellery or batfilery that can do the same thing. Or vbscript or whatever.
We could also skip the date stamping with āsimple versioningā when the number of versions is set to one, or something like that.
And regular bat files:
cmd.exe sync_move_files.bat
Doesnāt work. In syncthing.log file there is a message:
[ABUNC] 15:34:25 INFO: Puller (folder āfolderā, file āfile.jpgā): delete: exec: āC:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe D:\sync_move_files.ps1ā: file does not exist
Iām able to run scripts with these commands, no issues, but it doesnāt work from Syncthing.
What am I doing wrong? Have the latest version installed (0.11.5 Win 64).