I'm trying to accomplish the below with RSYNC but can't quite figure out the syntax. My source contains a folder for each user, then some subfolders under Logs. I need to capture everything under the numeric folder with the sync.
SOURCE DIRECTORY STRUCTURE:
/STORAGE/user1/db/Logs/151251/
/STORAGE/user1/db/Logs/156123/
/STORAGE/user1/db/Logs/117722/
/STORAGE/user2/db/Logs/178438/
/STORAGE/user2/db/Logs/161265/
PREFERRED DESTINATION DIRECTORY STRUCTURE
/LOGS/user1/151251/
/LOGS/user1/156123/
/LOGS/user1/117722/
/LOGS/user2/178438/
/LOGS/user2/161265
The command I've tried is:
rsync -azvr user@server.com:/STORAGE/*/db/Logs/*/ /LOGS/
This succeeds in copying all the files from all the numeric subfolders but I need to create the directory structure above (/LOGS/user/uniqueid/individual
files).
Is there a way to accomplish this?