![]() ![]() Since the original question also involves a desktop and laptop and example involving music files (hence he's probably using a GUI), I'd also mention one of the best bi-directional, multi-platform, free and open source programs to date: FreeFileSync. It still doesn't cover the question's use case completely, but it does implement two-way sync. Note 2: I am now currently using Mutagen for some purposes. I haven't had the need to have a two-way file synchronizer, so there may be better options, though. I am surprised it seems to be actively maintained now (last time I looked I think I thought it looked dead), but I'm not sure what's the state nowadays. unison may have its bugs (as any other piece of software) and its wrinkles. However, note that rsync is not designed for bidirectional sync, while unison is. Note: I am no longer using Unison (I use NextCloud, which doesn't address the original use case). ![]() Unison -batch dirA/ dirB/ asks no questions at all, and writes to output how many files were ignored (because they conflicted). Unison asks what to do when files are different, but you can automate the process by using the following which accepts default (nonconflicting) options: ![]() I guess this is only possible with a database and track of operations :P So, sometimes, server will have files that were deleted with a notebook sync, for example and then, when I run a sync with my desktop (where the deleted server files still exist on) I want these files to be deleted and not to be copied again to the server. If I want to delete server files on a syn, when local files have been deleted, it works, but if, for some reason (explained after) I have some files that aren't in the server but exist locally and they were deleted, I want locally to remove them and not server copied (as it happens). In rsync there is -delete and -delete-after options to help accomplish what I want but thing is, it doesn't work on a 2-way-sync. ![]() If there are deletions, it doesn't do anything. This works very well only if there are just updates or new files on the future. When I make sync-music, it first gets all the diffs from server to local and then the opposite, sending all the diffs from local to server. Rsync -avzru /media/Incoming/music/ server:/media/10001/music/ Rsync -avzru server:/media/10001/music/ /media/Incoming/music/ I now run something like this on a Makefile: get-music: I have a folder a/ and a remote folder A/. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |