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

后端 未结 6 1493
轮回少年
轮回少年 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 17:09

    I had a similar problem and cheated the rsync command,

    rsync -avz --delete root@x.x.x.x:/home//domains/site/public_html/ /home/domains2/public_html && chown -R wwwusr:wwwgrp /home/domains2/public_html/

    the && runs the chown against the folder when the rsync completes successfully (1x '&' would run the chown regardless of the rsync completion status)

提交回复
热议问题