Hello,
I need to move all the files inside /XYZ
(has multi-depth sub directories) that are older than 14 days to /ABC
directory but with retaining the SAME directory structure.
for example:
/XYZ/1/2/3/A/b.txt
should be moved as /ABC/1/2/3/A/b.txt
I know about find /XYZ -type f -mtime +14 -exec mv {} /ABC \;
but it would NOT retain the directory structure.
I thought of backing up whole /XYZ
to /ABC
and then delete recent 14 days' files from /ABC
and all files older than 14 days from /XYZ
but I find it very inefficient.
Appreciate any help. Thanks!