I ran into the same problem as you if the remote target directory is " /root/test " and I want to use rsync to replicate my files to the remote directory " /root/test/aaa/bbb ", then " failed: No such file or directory (2) "will be posted. The best solution is to give the command " ssh <username>@<remoteHostIP> mkdir -p <absolute_path> " to recursively create subdirectories on the remote host. Then use the rsync command.
user3322481
source share