I have a remote host with a service that is running by the
root user and creates dump file and I would like to sync to my local machine and remove them from the remote host:
rsync -avzr --remove-source-files my_remote_host:/home/ubuntu/dir .
However the above command created this error:
rsync: sender failed to remove dir/1.txt: Permission denied (13)
How do I remove the file on the remote server that is created by the root users of the remote machine?