Can’t rsync to www-data owned directory

I have a ubuntu 18.04 server running on GCP (nginx+php7). I’ve setup a directory /var/www/mysite.com which is drwxr-xr-x www-data:www-data. public_html/ is also drwxr-xr-x www-data:www-data. I’m using the following command to try to rsync the files to the directory (for automated deployment): rsync -azvp test/ [email protected]:/var/www/mysite.com/public_html/test/ However, when I do this, I get the following error:…

Details

before changed files inside folders, need to backup folders recursively different location

I have some files in specific location, i want to monitor the changes(read,write,execute permissions, ownership changes) inside the folders on time to time. Then need to backup that folder exclude some folders and different location.need to get backup files before changes happened. Can anyone help me write this task using shell script?

Details