Two way sync with rsync

后端 未结 10 1923
别那么骄傲
别那么骄傲 2021-01-29 18:50

I have a folder a/ and a remote folder A/. I now run something like this on a Makefile:

get-music:
 rsync -avzru server:/media/10001/music/ /media/Incoming/music         


        
10条回答
  •  后悔当初
    2021-01-29 19:26

    Try this,

    get-music:
     rsync -avzru --delete-excluded server:/media/10001/music/ /media/Incoming/music/
    
    put-music:
     rsync -avzru --delete-excluded /media/Incoming/music/ server:/media/10001/music/
    
    sync-music: get-music put-music
    

    I just test this and it worked for me. I'm doing a 2-way sync between Windows7 (using cygwin with the rsync package installed) and FreeNAS fileserver (FreeNAS runs on FreeBSD with rsync package pre-installed).

提交回复
热议问题