Hi All,
I don't know if this is better under scripting or general. However, I have this scenario:
I want to copy only the last two directories of a path to the destination. Let's say we have the source directory structure (from a backup structure)
I know if use --relative, I can do something like:
However, is it copying the entire directory path, as it should
but I was wondering if its possible to only send/copy the last two parts of the directory structure. I want to end up with the below (on the destination side):
I hope this makes sense, if I need to clarify. Please let me know. I'm still looking and experimenting myself.
I don't know if this is better under scripting or general. However, I have this scenario:
I want to copy only the last two directories of a path to the destination. Let's say we have the source directory structure (from a backup structure)
Code:
dir.20180601/mnt/path/to/directory/20180531/dir1
dir.20180602/mnt/path/to/directory/20180601/dir1
dir.20180603/mnt/path/to/directory/20180602/dir1
etc
rsync -avH --relative dir.*/mnt/path/to/directory/*/dir1 /destination/
However, is it copying the entire directory path, as it should

but I was wondering if its possible to only send/copy the last two parts of the directory structure. I want to end up with the below (on the destination side):
Code:
/destination/20180531/dir1
/destination/20180601/dir1
/destination/20180602/dir1
I hope this makes sense, if I need to clarify. Please let me know. I'm still looking and experimenting myself.