Rsync copy directory contents but not directory itself

前端 未结 4 1615
野趣味
野趣味 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:39

    It's simple,

    rsync /var/www/ /home/var - copies the contents of /var/www/ but not the www folder itself.

    rsync /var/www /home/var - copies the folder www along with all its contents.

    The "/" makes the difference.

提交回复
热议问题