rsync over SSH preserve ownership only for www-data owned files

后端 未结 6 1489
轮回少年
轮回少年 2021-02-05 16:36

I am using rsync to replicate a web folder structure from a local server to a remote server. Both servers are ubuntu linux. I use the following command, and it works well:

6条回答
  •  无人及你
    2021-02-05 16:48

    rsync version 3.1.2

    I mostly use windows in local, so this is the command line i use to sync files with the server (debian) :

    user@user-PC /cygdrive/c/wamp64/www/projects
    
    $ rsync -rptgoDvhP --chown=www-data:www-data --exclude=.env --exclude=vendor --exclude=node_modules --exclude=.git --exclude=tests --exclude=.phpintel --exclude=storage ./website/ username@hostname:/var/www/html/website
    

提交回复
热议问题