I'm trying to copy a folder using rsync
rsync -avP "$src_path" "$target_path"
Where src_path is a read-only directory. AFAIK, to copy, the source doesn't have to be modifiable while only the target needs to be writable (...duh!).
But rsync is giving me this error.
rsync: recv_generator: mkdir $target_path/sub_dir failed: Read-only file system (30)
*** Skipping any contents from this failed directory ***
If I copy using rsync from a writable source I don't get this error,
If I copy using cp from a read-only source I don't get this error.
TLDR; I want to use rsync to copy read-only source.
Edit: Don't ask me to get write access to the source folder, that is not possible (i.e. it's not owned by me), besides that's out of this question's scope.
Edit(2): To reproduce,
- Go to this drive folder link
- Add a shortcut to your drive
- Now to Google Colab and try to copy the folder using rsync
- You'll fail using rsync, now try to copy using the cp and you'll be successful.
Update: If src_path is a read-only file, rsync works. but if it's a folder it doesn't work. (cp and tar working on all conditions)
P.S. I don't want to use cp, I want to use rsync (so please don't suggest me to use anything less powerful than rsync).