Keep Remote Directory Up-to-date

后端 未结 17 1724
一向
一向 2021-01-30 06:39

I absolutely love the Keep Remote Directory Up-to-date feature in Winscp. Unfortunately, I can\'t find anything as simple to use in OS X or Linux. I know the same thing can

17条回答
  •  清歌不尽
    2021-01-30 07:28

    Great question I have searched answer for hours !

    I have tested lsyncd and the problem is that the default delay is far too long and no example command line give the -delay option.

    Other problem is that by default rsync ask password each time !

    Solution with lsyncd :

    lsyncd --nodaemon -rsyncssh local_dir remote_user@remote_host remote_dir -delay .2
    

    other way is to use inotify-wait in a script :

    while inotifywait -r -e modify,create,delete local_dir ; do
        # if you need you can add wait here
        rsync -avz local_dir remote_user@remote_host:remote_dir
    done
    

    For this second solution you will have to install inotify-tools package

    To suppress the need to enter password at each change, simply use ssh-keygen : https://superuser.com/a/555800/510714

提交回复
热议问题