0

I have a local folder with a lot of files that are ~200MB in size. I want to use those files locally, but also upload them to a webdav share.

I've mounted the webdav share, and I've setup rsync to archive my local folder into the webdav share every week. I've set the webdav cache size to max 2GB. But the webdav mount folder size keeps growing, because the newly archived files (which are put there by rsync) are not deleted from the local machine.

Is there a way to delete those files locally meanwhile preserving them on the webdav host?

djsmiley2kStaysInside
  • 6,643
  • 2
  • 31
  • 43
user1226868
  • 179
  • 9

1 Answers1

0

You need to pass the --remove-source-files option to the rsync command. It tells rsync to remove from the sending side the files (meaning non-directories) that are a part of the transfer and have been successfully duplicated on the receiving side. Do not pass the --delete option to rsync command as it delete extraneous files from destination directory.

More information at https://www.cyberciti.biz/faq/linux-unix-bsd-appleosx-rsync-delete-file-after-transfer/

djsmiley2kStaysInside
  • 6,643
  • 2
  • 31
  • 43