You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Everybody.
I really enjoy seeing this project grow and getting better.
I would like to request the feature "One way sync". I am thinking of a repo which is just collecting data, but is not repeating deletions on the other repos.
For example connecting the phone with the computer. I want to have all pictures on the pc in one directory, but i only have some pictures on the phone. So, if i delete a picture on the phone, it should stay on the pc.
But this would not be what I want.
If a new picture is taken on the phone, it gets uploaded to the server .
If the picture is deleted after the upload is completed, the pic should stay on the server
Yes, I think you cannot achieve this at the moment.
Though what happens if you create a file on your phone called test.txt, sync it to your pc, delete it off the phone, and later create it on your phone again later with the same name?
This can happen with the phone naming pictures in a IMG_XXX.jpg fashing where XXX being the next available integer.
@AudriusButkevicius : Though what happens if you create a file on your phone called test.txt, sync it to your pc, delete it off the phone, and later create it on your phone again later with the same name?
I would say: Sync it, and mark it as in conflict on the server.
The Android phones use date and time for the pics, but i get your meaning. Again, here i might suggest sync it, and mark it as in conflict on the server.
@rom1504 : Every so often i travel. I enjoy choosing and having the best pictures on the phone while i am sure at home all is kept well by the server. Taking a long busride is just the time to review and sort these pictures.
This functionality is provided by Dropbox and BTSync.. And I even think Syncthing should not be a copy of these two, I really think this function would add value here.
Let's say we have a cluster with three nodes, ABC. A creates a file and syncs it to the two other nodes.
#62 is: B is setup as readonly node. B deletes the file. A and C should still have it. (For A this could be done with A as repo master) C deletes the file. A should delete it as well. (This step is why repo master won't work)
This is: B is setup as a one-way sync from A. A deletes the file. B should still have it. C shouldn't. (Also does not work with repo master)
This is:
B is setup as a one-way sync from A.
A deletes the file. B should still have it. C shouldn't. (Also does not work with repo master)
That's not a one way sync, though. A one way sync here would be B deletes or changes the file and A doesn't care. You're talking about a sync-some-changes-but-not-others where B ignores deletes from A, but maybe allows updates to files and maybe renames, combined with some one way sync so that changes directly on B is ignored.
I could see this being solved by having on and off switches for all of creates, changes, deletes, and metadata changes, for both incoming and outgoing directions, per peer node. Actually figuring out who is in sync with what in such a setup could be something of a nightmare though...
(Interestingly, something like this was possible before we fixed the .stignore functionality. Previously, if I ignored everything in my .stignore, I would still receive updates for those files from other peers but anything I did locally would be ignored.)
I can offer that scheme of sync. Files keep in repository, until it exsist on any one node (for example: if it deletede from A and B and kept on C it restored in next sync with C), if it deleted on all nodes between sync, than information about this file deleted from database of synced files. When file changed on one node, then on other nodes, saved it old version (in version directory, like it happen usually when version control is switched on), and synced new file and old version between all nodes (some kind of incremental backup).
But as i think, that scheme is not what wanted bigbear2nd. For him, i think, the "Upload" repo is ideal (like flickr on phones for example), phone upload all files to server, but don't automaticly download anything from server, and server make some kind of version control when conflicts are appeared.
I use Dropbox for backing-up camera pictures from my Android, but I am planing to migrate to Syncthing/Pulse for this and more…
Here is how it works with Dropbox:
A: android smartphone, is an "uploader"
B: Dropbox server
C: computer
Adding pictures:
A has new picture: picture pushed to B, then 2) happens
B has new picture: picture pushed to C (not to A)
C has new picture: picture pushed to B (not to A)
Deleting pictures –applies also to modification-:
4) A deletes pictures: nothing else happens
5) B deletes pictures: deletion propagated to C (not to A)
6) C deletes pictures: deletion propagated to B (not to A)
The idea behind the implementation is easy here: node A is seen as an “uploader” node; node A just ignores every file event (like create, rename, modification, new file, deletion, … any!) from other nodes.
To solve the problem in Syncthing/Pulse, I see in node A a configuration flag “uploader-only” on the folder configuration, for which node A will only upload new files; keep it easy!
Does it sound difficult to code in Syncthing/Pulse?
Regarding version control, in case of pictures it is not important at all. The intent here with Syncthing/Pulse is just to upload pictures from A to C (we do not have any B server in the middle). I would say that in case A uploads again a new picture with the same name, C should just overwrite it. In case more uploader-only nodes are present for the same folder, and a picture with the same filename is uploaded, it would be sufficient if C keeps the old picture (not sure how Dropbox makes it here).
A node with "uploader-only" flag set for a certain folder should only upload the files contained on it.
Here is where things get more complex: should pictures be uploaded again from A if I delete files from C, but still keep them on A? The easy but annoying solution would be that A uploads again the pictures to C. I have no clear opinion on this, but I know that in Dropbox if I delete pictures from B or C, the pictures are not uploaded again from A, therefore my suggestion would maybe be to save an ".uploaded" configuration file in the folder to keep track of which file has been already uploaded to ... to what? To the master node for this folder, which could be C in this example with Syncthing/Pulse.
A use-case at this point would be that I delete pictures from C to copy them to an external HD to store them, but I keep them in A to still access them on my smartphone. If I move the pictures from C to an external HD I do not want to have the pictures to magically appear again on C, and I don't want to click any GUI button in Syncthing/Pulse. This should be just automated. Probably the "upload only" approach can be somehow implemented here like "upload only, but don't upload again if the master node received from me a copy of it (and I kept track of it)". This means that an "upload-only" node like A would be entitled to upload files to a master node like C, even if A is not the master node for the given folder (!). So, for such an use-case we must have one master node, and zero to many "upload only" nodes. I believe this is the solution.
Feature suggestions go on the forum, please. This sounds pretty similar to the recent "one time sync" thread.
In addition, using directives like "Syncthing should" is likely to start a confrontation: "it should do this", "no it shouldn't", etc. Instead, try phrasing your request as a suggestion.
Activity
jpjp commentedon Aug 28, 2014
You can make a repository a master, so that it ignores all changes from other repositories.
bigbear2nd commentedon Aug 28, 2014
But this would not be what I want.
If a new picture is taken on the phone, it gets uploaded to the server .
If the picture is deleted after the upload is completed, the pic should stay on the server
AudriusButkevicius commentedon Aug 28, 2014
Yes, I think you cannot achieve this at the moment.
Though what happens if you create a file on your phone called
test.txt, sync it to your pc, delete it off the phone, and later create it on your phone again later with the same name?This can happen with the phone naming pictures in a IMG_XXX.jpg fashing where XXX being the next available integer.
rom1504 commentedon Aug 28, 2014
I think it would be much easier if you just moved (=delete from the sync dir) the files on the pc, so it get deleted on the phone too.
bigbear2nd commentedon Aug 28, 2014
@AudriusButkevicius : Though what happens if you create a file on your phone called test.txt, sync it to your pc, delete it off the phone, and later create it on your phone again later with the same name?
I would say: Sync it, and mark it as in conflict on the server.
The Android phones use date and time for the pics, but i get your meaning. Again, here i might suggest sync it, and mark it as in conflict on the server.
@rom1504 : Every so often i travel. I enjoy choosing and having the best pictures on the phone while i am sure at home all is kept well by the server. Taking a long busride is just the time to review and sort these pictures.
This functionality is provided by Dropbox and BTSync.. And I even think Syncthing should not be a copy of these two, I really think this function would add value here.
calmh commentedon Aug 31, 2014
This is #62, although the description there is kind of terse. This adds a clear use case.
StrikerTwo commentedon Sep 16, 2014
This is not really #62.
Let's say we have a cluster with three nodes,
ABC. A creates a file and syncs it to the two other nodes.#62 is:
Bis setup as readonly node.Bdeletes the file.AandCshould still have it. (ForAthis could be done withAas repo master)Cdeletes the file.Ashould delete it as well. (This step is why repo master won't work)This is:
Bis setup as a one-way sync fromA.Adeletes the file.Bshould still have it.Cshouldn't. (Also does not work with repo master)calmh commentedon Sep 16, 2014
That's not a one way sync, though. A one way sync here would be
Bdeletes or changes the file andAdoesn't care. You're talking about a sync-some-changes-but-not-others whereBignores deletes fromA, but maybe allows updates to files and maybe renames, combined with some one way sync so that changes directly onBis ignored.I could see this being solved by having on and off switches for all of creates, changes, deletes, and metadata changes, for both incoming and outgoing directions, per peer node. Actually figuring out who is in sync with what in such a setup could be something of a nightmare though...
(Interestingly, something like this was possible before we fixed the .stignore functionality. Previously, if I ignored everything in my .stignore, I would still receive updates for those files from other peers but anything I did locally would be ignored.)
StrikerTwo commentedon Sep 16, 2014
You are right, I simply used the OPs terminology.
"One time sync" might be more accurate.
But whatever we call it, it's not exactly #62. And yes, I can see that this might get quite complex.
How do other apps solve this? I know that BTSync doesn't cover that use case. Any Dropbox users?
maddisk commentedon Oct 20, 2014
I can offer that scheme of sync. Files keep in repository, until it exsist on any one node (for example: if it deletede from A and B and kept on C it restored in next sync with C), if it deleted on all nodes between sync, than information about this file deleted from database of synced files. When file changed on one node, then on other nodes, saved it old version (in version directory, like it happen usually when version control is switched on), and synced new file and old version between all nodes (some kind of incremental backup).
But as i think, that scheme is not what wanted bigbear2nd. For him, i think, the "Upload" repo is ideal (like flickr on phones for example), phone upload all files to server, but don't automaticly download anything from server, and server make some kind of version control when conflicts are appeared.
ovizii commentedon Oct 21, 2014
@maddisk : that sounds great
the-innovator commentedon Oct 24, 2014
I use Dropbox for backing-up camera pictures from my Android, but I am planing to migrate to Syncthing/Pulse for this and more…
Here is how it works with Dropbox:
A: android smartphone, is an "uploader"
B: Dropbox server
C: computer
Adding pictures:
Deleting pictures –applies also to modification-:
4) A deletes pictures: nothing else happens
5) B deletes pictures: deletion propagated to C (not to A)
6) C deletes pictures: deletion propagated to B (not to A)
The idea behind the implementation is easy here: node A is seen as an “uploader” node; node A just ignores every file event (like create, rename, modification, new file, deletion, … any!) from other nodes.
To solve the problem in Syncthing/Pulse, I see in node A a configuration flag “uploader-only” on the folder configuration, for which node A will only upload new files; keep it easy!
Does it sound difficult to code in Syncthing/Pulse?
Regarding version control, in case of pictures it is not important at all. The intent here with Syncthing/Pulse is just to upload pictures from A to C (we do not have any B server in the middle). I would say that in case A uploads again a new picture with the same name, C should just overwrite it. In case more uploader-only nodes are present for the same folder, and a picture with the same filename is uploaded, it would be sufficient if C keeps the old picture (not sure how Dropbox makes it here).
A node with "uploader-only" flag set for a certain folder should only upload the files contained on it.
Here is where things get more complex: should pictures be uploaded again from A if I delete files from C, but still keep them on A? The easy but annoying solution would be that A uploads again the pictures to C. I have no clear opinion on this, but I know that in Dropbox if I delete pictures from B or C, the pictures are not uploaded again from A, therefore my suggestion would maybe be to save an ".uploaded" configuration file in the folder to keep track of which file has been already uploaded to ... to what? To the master node for this folder, which could be C in this example with Syncthing/Pulse.
A use-case at this point would be that I delete pictures from C to copy them to an external HD to store them, but I keep them in A to still access them on my smartphone. If I move the pictures from C to an external HD I do not want to have the pictures to magically appear again on C, and I don't want to click any GUI button in Syncthing/Pulse. This should be just automated. Probably the "upload only" approach can be somehow implemented here like "upload only, but don't upload again if the master node received from me a copy of it (and I kept track of it)". This means that an "upload-only" node like A would be entitled to upload files to a master node like C, even if A is not the master node for the given folder (!). So, for such an use-case we must have one master node, and zero to many "upload only" nodes. I believe this is the solution.
Keep it up, guys!!
diedrichg commentedon Mar 25, 2015
This is the single reason I have not switched from BTSync to Syncthing. Make the one-way backup feature and I'll switch for good!
canton7 commentedon May 23, 2017
Feature suggestions go on the forum, please. This sounds pretty similar to the recent "one time sync" thread.
In addition, using directives like "Syncthing should" is likely to start a confrontation: "it should do this", "no it shouldn't", etc. Instead, try phrasing your request as a suggestion.