How to keep two folders automatically synchronized?

前端 未结 5 1137
醉话见心
醉话见心 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:07

    Just simple modification of @silgon answer:

    while true; do 
      inotifywait -r -e modify,create,delete /directory
      rsync -avz /directory /target
    done
    

    (@silgon version sometimes crashes on Ubuntu 16 if you run it in cron)

提交回复
热议问题