How to keep the full path with rsync

backupdirectorypathrsync

When backing up with rsync, How do I keep the full directory structure?

For example, the remote server is saturn, and I want to backup saturn's /home/udi/files/pictures to a local directory named backup.

I want to have (locally) backup/home/udi/files/pictures rather than backup/pictures.

Best Answer

Use the -R or --relative option to preserve the full path.