Rsync copy directory contents but not directory itself

前端 未结 4 1575
野趣味
野趣味 2021-01-30 19:29

I\'m trying to synchronize two contents of folders with different name:

rsync -av ~/foo user@remote.com:/var/www/bar

I\'d like to copy the cont

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-30 19:53

    Navigate into the directory you would like to copy over, so:

    cd ~/foo 
    

    Run this:

    rsync -avz . user@remote.com:/var/www/bar
    

提交回复
热议问题