Hi,
We have directories and sub-directories and files and under
/var/myapp/
and need to move only those files which are older than 90 days.
While moving them to
/tmp/myapp/
we need to make sure that the complete hierarchy of the file / directory is also maintained such that
/var/myapp/project1/fil1 ... file9 ... dir1 .. dir2 ..
are moved to /tmp/myapp as
/tmp/myapp/project1/fil1 ... file2 ...n ... dir1 ... dir2..
Actually, we need to archive / compress the files older than 90 days and also maintain the hierarchy in the compressed file containing all the matched directories / files as found by the command find:
Code:
find /var/myapp -mtime +90
So, how do I archive the files / directories returned by the above command in a way that when they are archived under /tmp/myapp they have their complete path as shown below:
/tmp/myapp/project1.gz
and project.gz when decompressed / untarred it should show the complete path.