|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
need help urgently on unix scripting
same file(file name is same, but the content is different) exists on subdirectories of a particular directory.
for ex: i need to search a 'xlog' file which is present under 'cnet' directory (as well as subdirectories of cnet) and need to move to a new directory 'tempdir' by creating the directory of where it resides and copy that 'xlog' to that place. /Ofwr.sys/xlog /Ofwr.sys/cl7/archive/xlog /Ofwr.sys/tdm/tbl/sfm1/xlog /Ofwr.sys/tdm/trn/route/xlog /Ofwr.sys/tdm/trn/gsc3/xlog I tried.. but no luck..(as a single command) find . -name xlog -exec cp {} tempdir \; (It tries to copy all the xlog files of different directories to the directory 'tempdir' and throwing error identical xlog, same file name, not creating directories) cp -r /usr/cnet/*xlog tempdir (It's copying only the xlog file present in that cnet directory) Thanx in advance for the help... |
|
#2
|
|||
|
|||
|
same file(file name is same, but the content is different) exists on subdirectories of a particular directory.
for ex: i need to search a 'xlog' file which is present under 'cnet' directory (as well as subdirectories of cnet) and need to move to a new directory 'tempdir' by creating the directory of where it resides and copy that 'xlog' to that place. /Ofwr.sys/xlog /Ofwr.sys/cl7/archive/xlog /Ofwr.sys/tdm/tbl/sfm1/xlog /Ofwr.sys/tdm/trn/route/xlog /Ofwr.sys/tdm/trn/gsc3/xlog I tried.. but no luck..(as a single command) find . -name xlog -exec cp {} tempdir \; (It tries to copy all the xlog files of different directories to the directory 'tempdir' and throwing error identical xlog, same file name, not creating directories) cp -r /usr/cnet/*xlog tempdir (It's copying only the xlog file present in that cnet directory) Thanx in advance for the help... |
|
#3
|
|||
|
|||
|
I got it..
find . -name xlog | cpio -pdumv logfilesdir extending this, Is there any way we could concatenate the path names into the filename so that all files could be in the same directory at the top level? Example: i want the file name has to be Ofwr.sysxlog , Ofwr.syscl7archivexlog (/Ofwr.sys/xlog, /Ofwr.sys/cl7/archive/xlog) and copy total files into one directory Thanx in advance for help.. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > need help urgently on unix scripting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|