Re: keep 2 dirs in sync
On Sat, Jul 2, 2011 at 7:32 PM, Mark Constable ma...@renta.net wrote: Would anyone know of any project written in C/C++ based directly on rsync, and maybe Git? The rsync resources page mentions dsync, which is (IIRC) a perl script wrapper around rsync. ..wayne.. -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: keep 2 dirs in sync
On 2011-07-01 09:40 PM, Chris Dennis wrote: I have two hosts (my portable and my desktop). I work on both hosts at different times and so I keep a few dirs sync'd between the two. I have a docs dir where I may be modifying files, adding files, renaming files and deleting files on *either* host. You may want to investigate unison, which is designed for such usage. It's written in OCaml. Or syncany -- www.syncany.org Sigh, excellent concept but it's mostly in Java which is unacceptable for me. Would anyone know of any project written in C/C++ based directly on rsync, and maybe Git? If not then would anyone be interested in starting such a project with similar goals to Syncany but only for *nix? -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
keep 2 dirs in sync
I don't think there's a direct way to do this with rsync but I want to make sure I'm not missing something. I have two hosts (my portable and my desktop). I work on both hosts at different times and so I keep a few dirs sync'd between the two. I have a docs dir where I may be modifying files, adding files, renaming files and deleting files on *either* host. I have a nightly cron script (run on hosta) sync the docs dir on the two hosts that does; rsync -au --delete hostb:docs/ docs # sync0 rsync -au --delete docs/ hostb:docs # sync1 which takes care of modified files on either host - last mod wins. That works. Problem is adding, deleting and renaming files. I'm sure most know the problem here but I'll illustrate it to be clear; If I add a new file91 on hostb then the nightly script copies file91 from hostb to hosta and I'm happy. But if I add a new file92 on hosta then the sync0 deletes file92 from hosta. Not happy. Then there is a corresponding opposite problem with deleting (and renaming) files. If I intentionally delete a file92 on hostb (which was previously sync'd on both hosts) then it gets copied back to hostb from hosta by sync1, which is not desired. What I've been doing, for years, is doing the rsyncs without the --delete and then when I want to delete something I have to remember to delete it from both hosts manually. Am I missing something? Is there some other direct way to do this? It appears that one would need a utility that maintained a separate copy of the dirs in order to know what had been deleted before performing the sync. This has probably been discussed ad nauseam in the rsync community but I haven't been able to find it. Other solutions? Thanks Mike -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: keep 2 dirs in sync
On Fri 01 Jul 2011, Michael Makuch wrote: I have two hosts (my portable and my desktop). I work on both hosts at different times and so I keep a few dirs sync'd between the two. I have a docs dir where I may be modifying files, adding files, renaming files and deleting files on *either* host. You may want to investigate unison, which is designed for such usage. Paul -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: keep 2 dirs in sync
On 01/07/11 17:44, Paul Slootman wrote: On Fri 01 Jul 2011, Michael Makuch wrote: I have two hosts (my portable and my desktop). I work on both hosts at different times and so I keep a few dirs sync'd between the two. I have a docs dir where I may be modifying files, adding files, renaming files and deleting files on *either* host. You may want to investigate unison, which is designed for such usage. Or syncany -- www.syncany.org cheers Chris -- Chris Dennis cgden...@btinternet.com Fordingbridge, Hampshire, UK -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html