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?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.