Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
77
rated 0 times [  77] [ 0]  / answers: 1 / hits: 40827  / 3 Years ago, mon, july 26, 2021, 2:51:17

When I do something like:



rsync Videos/YouTube/LetsPlays foo@bar:/home/foo/


The resulting directory structure looks like:



/home/foo/LetsPlays


I've read the man pages but couldn't an option to maintain the directory structure, aiming for



/home/foo/Videos/YouTube/LetsPlays


as result. Any ideas?



As always thanks in regards,
Markus


More From » rsync

 Answers
4

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



If you do not want the full path of the remote file, but only part of that, rsync offers this feature since version 2.6.7 (this is the version on the sending side which is the local side in your case).



Just insert a dot /./ into the path where you want to break the path



Ex:



rsync --relative Videos/./YouTube/LetsPlays foo@bar:/home/foo/


would result in this remote path:



/home/foo/YouTube/LetsPlays

[#22310] Wednesday, July 28, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
humbire

Total Points: 55
Total Questions: 93
Total Answers: 113

Location: Oman
Member since Fri, Dec 23, 2022
1 Year ago
humbire questions
Thu, May 13, 21, 02:28, 3 Years ago
Sun, Oct 24, 21, 14:23, 3 Years ago
Wed, May 17, 23, 22:16, 1 Year ago
;