Hi, a small problem here, and I need some advise how this can be done.
I have a collection directory that is getting files from many different directories, unfortnatly with the same file name, expect for the time-stamp. The time stamp is the only way to find out which directory it came from.
I want to make it easier to see where the file came from.
Here's a file structure layout.
/usr/local/tmp/dir1 = PIN
/usr/local/tmp/dir3 = CC
/usr/local/tmp/dir4 = RP
DIRECTORY STRUCTURE VIEW:
/usr/collection/
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
/usr/local/tmp/dir1
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
/usr/local/tmp/dir3
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
/usr/local/tmp/dir4
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
Wanting results:
/usr/collection/
FILE.ZIP.PIN.01252006-102055
FILE.ZIP.PIN.01252006-102555
FILE.ZIP.PIN.01252006-103055
FILE.ZIP.PIN.01252006-103555
FILE.ZIP.RP.01252006-102655
FILE.ZIP.RP.01252006-103655
FILE.ZIP.RP.01252006-104655
FILE.ZIP.CC.01252006-102155
FILE.ZIP.CC.01252006-102155
FILE.ZIP.CC.01252006-102155
/usr/local/tmp/dir1
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
/usr/local/tmp/dir3
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
/usr/local/tmp/dir4
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
I am trying to make this to a function in a script, where I can add more directories that has files I want in my /usr/collection directory. A seperate scripts is fine as well.
Any suggestions how this can be done? Or any advises?
Thanks in advance.
Ps, the files from the orginal directory cannot be changed or touched, just copied to /usr/collection
I have a collection directory that is getting files from many different directories, unfortnatly with the same file name, expect for the time-stamp. The time stamp is the only way to find out which directory it came from.
I want to make it easier to see where the file came from.
Here's a file structure layout.
/usr/local/tmp/dir1 = PIN
/usr/local/tmp/dir3 = CC
/usr/local/tmp/dir4 = RP
DIRECTORY STRUCTURE VIEW:
/usr/collection/
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
/usr/local/tmp/dir1
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
/usr/local/tmp/dir3
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
/usr/local/tmp/dir4
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
Wanting results:
/usr/collection/
FILE.ZIP.PIN.01252006-102055
FILE.ZIP.PIN.01252006-102555
FILE.ZIP.PIN.01252006-103055
FILE.ZIP.PIN.01252006-103555
FILE.ZIP.RP.01252006-102655
FILE.ZIP.RP.01252006-103655
FILE.ZIP.RP.01252006-104655
FILE.ZIP.CC.01252006-102155
FILE.ZIP.CC.01252006-102155
FILE.ZIP.CC.01252006-102155
/usr/local/tmp/dir1
FILE.ZIP.01252006-102055
FILE.ZIP.01252006-102555
FILE.ZIP.01252006-103055
FILE.ZIP.01252006-103555
/usr/local/tmp/dir3
FILE.ZIP.01252006-102655
FILE.ZIP.01252006-103655
FILE.ZIP.01252006-104655
/usr/local/tmp/dir4
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
FILE.ZIP.01252006-102155
I am trying to make this to a function in a script, where I can add more directories that has files I want in my /usr/collection directory. A seperate scripts is fine as well.
Any suggestions how this can be done? Or any advises?
Thanks in advance.
Ps, the files from the orginal directory cannot be changed or touched, just copied to /usr/collection