I would like to use rsync to sync some directories from a remote server to my local machine. In order to keep the files organized i would like rsync to create/copy the whole path with all the parent directories.
I am using ssh with certificate files so no manual login is required.
If i use it like following it copies the file.crt but does not create the parent directories:
rsync -ave ssh [email protected]:/opt/dir/data/file.crt /home/user1/
If i try to use the -R --recursive option it fails with the error below:
rsync -ave --recurisive ssh [email protected]:/opt/dir/data/file.crt /home/user1/
or with -R
rsync -aveR ssh [email protected]:/opt/dir/data/file.crt /home/user1/
Unexpected remote arg: [email protected]:/opt/dir/data/file.crt
rsync error: syntax or usage error (code 1) at main.c(1361) [sender=3.1.2]
Thanks for any help in advance