Dear Unix Experts,
I am trying to backup some legacy data based on date. I am pasting a small portion from the ls -al command from my session for reference.
athena>ls -al
./nmr/exam1d_13C:
total 32
drwxrwxrwx 3 root root 4096 May 1 2008 1/
drwxrwxrwx 3 root root 4096 Apr 11 2008 2/
drwxrwxrwx 14 root root 4096 Jan 22 2008 ../
drwxrwxrwx 3 root root 4096 Jan 13 2005 6/
drwxrwxrwx 3 root root 4096 Jan 13 2005 5/
drwxrwxrwx 8 root root 4096 Mar 30 2004 ./
./nmr/exam2d_HC:
total 24
drwxrwxrwx 3 root root 4096 Apr 11 2008 1/
drwxrwxrwx 3 root root 4096 Dec 21 2004 4/
drwxrwxrwx 14 root root 4096 Jan 22 2008 ../
drwxrwxrwx 6 root root 4096 Mar 30 2004 ./
I am trying to archive these files based on the year like below. Just to complicate things a little bit more, I expect to see sub-directories like 1/ 2/ and so on. under ./nmr/exam1d_13C/1 etc.
./nmr/exam1d_13C/1 to /archive/2008/nmr/exam1d_13C/1
./nmr/exam1d_13C/2 to /archive/2008/nmr/exam1d_13C/2
./nmr/exam1d_13C/5 to /archive/2005/nmr/exam1d_13C/5
./nmr/exam1d_13C/6 to /archive/2005/nmr/exam1d_13C/6
./nmr/exam2d_HC/1 to /archive/2008/nmr/exam2d_HC/1
./nmr/exam2d_HC/4 to /archive/2008/nmr/exam2d_HC/4
I am stuck. I tried using find, but with no success. I would appreciate any help.
Thanks
Jaison
Next time use CODE-tags when posting code, data or logs to enhance readability and keep formatting like indention etc., ty.