How to keep two folders automatically synchronized?

前端 未结 5 1172
醉话见心
醉话见心 2021-01-29 19:26

I would like to have a synchronized copy of one folder with all its subtree.

It should work automatically in this way: whenever I create, modify, or delete stuff from th

5条回答
  •  你的背包
    2021-01-29 20:12

    You need something like this: https://github.com/axkibe/lsyncd It is a tool which combines rsync and inotify - the former is a tool that mirrors, with the correct options set, a directory to the last bit. The latter tells the kernel to notify a program of changes to a directory ot file. It says:

    It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes.

    But - according to Digital Ocean at https://www.digitalocean.com/community/tutorials/how-to-mirror-local-and-remote-directories-on-a-vps-with-lsyncd - it ought to be in the Ubuntu repository!

    I have similar requirements, and this tool, which I have yet to try, seems suitable for the task.

提交回复
热议问题