2

I'm trying to copy a folder using rsync

rsync -avP "$src_path" "$target_path"

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 ***

Here src_path is a read-only directory but the target_path is writable.

I can easily do the copy using cp but rsync fails.

1 Answers1

1

TLDR: The issue is caused by the old version of rsync (here in my case 3.1.2). Just update it to the latest version and that should solve the problem.

The known tested version that has this issue fixed is 3.2.3.

If you can't install the latest version on older ubuntu, follow here Install latest version of rsync (3.2.3) on ubuntu 18.04

Old, just kept as a reference:

It turns out that, this is a bug of rsync which was fixed in later versions.

The version provided by google collab is 3.1.2 (buggy), while the latest version is 3.2.3 (which has the issue fixed).

!apt update && apt upgrade -y doesn't upgrade rsync to 3.2.3.

Not recommended, follow the method provided above

I needed to manually download and install from here. (And yes, I also had to download and update all the listed dependencies manually the same way).