Script to search and copy files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Script to search and copy files
# 8  
Old 07-13-2012
It ran but none of the files were copied over.
This is the actual script looks like
Code:
while read FILE; do
  find /home/neigroup/Desktop/neigroup/NEI\ Docs/GOLDPROD/PICTURES/  -name "$FILE.*" -type f -exec cp {}  /home/neigroup/Desktop/neigroup/andy/ \;
done < gold.txt

Both Directories are correct. All folders and files are chmod to 777.

Moderator's Comments:
Mod Comment code tags please

Last edited by jim mcnamara; 07-13-2012 at 05:36 PM..
# 9  
Old 07-13-2012
Post output of file gold.txt.
# 10  
Old 07-13-2012
Code:
9978
9979
B093155
B6174
B6242-P
B6242-W
B6242-Y
C05018
C327118
C6167
C6169
C6176
C6240
C6255
DS1-16
DS1-18
DS2-18
DS2-20
D21
D25
D25S
D29S
EA3070
EA3100
EA3133-J
EA3231
EA341
ERT3358
ER3543 
ER3177
ER3358
ER3543 
ER3703
ER3944
ER3956
ER4072R
ER431
ER5185 
ER5197 
ER5328 
ER5437 
ER5728
ER5730
ER5731 
ER5874
ER6165
ER6167
ER6177
ER6182
ER6209
ER6209
ER6210
ER6211
ER6212
ER6213
ER6213
ER6214
ER6215
ER6216
ER6216
ER6217
ER6217
ER6233
ER6233
ER6235
ER6255
FLAT SNAKE 2MM
FR10
FR10
FR10
HMF20-7
HMF20DB-7
OV3 BOX
P6146
P6148
P6149
P6165
RM12-16
RM12-18
RM12-20
RM12-24
RM16-16
RM16-18
RM16-20
RM18-16
RM18-20
RM18-24
RM18-7.5
RM18-9
RM21-16
RM21-17.5
ROPE CHAIN
RPX09
RPX12-16
RPX12-18
RPX12-20
RPX12-24
RPX12-30
RPX14-16
RPX14-18
RPX14-18
RPX14-20
RPX14DB-7
RPX18-20
RPX18-20
RPX18-24
RPX18-7
RPX18-9
RPX18DC-7
RPX23-16
RPX23
RPX23-18
RPX23-20
RPX23-7
RPX30-30
RPX30-7
RPX30-8
RPX33-24
RPX35-18
RPX35-30
RPX35DC-24
RW40-18
RW40-20
RW40-24
RW40-30
RW50-16
RW50-18
RW50-20
RW50-24
RW50-30

# 11  
Old 07-13-2012
It is not what I meant. I want to see the output of command file with gold.txt as argument.
# 12  
Old 07-16-2012
This is what I get.
root@server:/home/neigroup/Desktop/neigroup# ./scp
root@server:/home/neigroup/Desktop/neigroup#
# 13  
Old 07-17-2012
Does anyone have an idea why it doesn't work?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search and Copy Files

Hi All Need your help, I am looking for a script to search for files with specific extension as .log and then copy the latest one to a different folder. Here is the scenario /dev/abc/xyz/a_2_122920131.log /dev/abc/xyz/a_2_123020131.log /dev/abc/xyz/b_2_12302013.log... (2 Replies)
Discussion started by: jimmun
2 Replies

2. Shell Programming and Scripting

Find and copy files based on todays date and search for a particular string

Hi All, I am new to shell srcipting. Problem : I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies

3. Shell Programming and Scripting

Recursive search for files and copy to new directories

So I have extremely limited experience with shell scripting and I was hoping someone could point out a few commands I need to use in order to pull this off with a shell script like BASH or whatnot (this is on OS X). I need to search out for filenames with account numbers in the name itself... (3 Replies)
Discussion started by: flyawaymike
3 Replies

4. Shell Programming and Scripting

Copy Files with script

Hello, I have written a script to copy files from one partion to another. Not sure if this is correct. #!/bin/sh CDR_SOURCE=/storage/archive/logmgmt/result/billing/ CDR_DEST=/storage4/archive/logmgmt/result/billing/ cp $CDR_SOURCE $CDR_DEST; exit 0 The CDR_SOURCE folder has... (5 Replies)
Discussion started by: Siddheshk
5 Replies

5. Shell Programming and Scripting

sed help - search/copy from one file and search/paste to another

I am a newbie and would like some help with the following - Trying to search fileA for a string similar to - AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3 I then want to replace that string with a string from fileB - ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies

6. Shell Programming and Scripting

Search and Copy Script

Dear All, I would like to create a Unix script which basically searches for files which are more than 2 days old and copy only the new files to the destination. What i mean is if the destination may have most of the files, it may not have only last 2 to 3 days file. I am able to create the... (6 Replies)
Discussion started by: rrb2009
6 Replies

7. Shell Programming and Scripting

Shell Script to Search for a particular String and copy the timestamp to a variable

Hi, We Perfrom Loads to the database through a Perl script which generates a statistics file. I need to read the statistics. the Statistics file looks something like below: Process Beginning - 08-26-2010-23.41.47 DB2 CONNECTION SUCCESSFUL! Ready to process and load file: FILENAME # of... (2 Replies)
Discussion started by: Praveenkulkarni
2 Replies

8. Shell Programming and Scripting

shell script to search and copy files

Hello Im new to this forums, I would like some help regarding a script that I need in order to copy some files. Heres the scenario: I need to search several files which have a particular code inside, lets say "test" all of them on different directories. I need to copy all of them on a new... (4 Replies)
Discussion started by: c.watson
4 Replies

9. Shell Programming and Scripting

search files and copy them to a directory with datestamp attacched to it

Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it. Iam using following command to search the files find $CA_OUT_PATH/*/ftp_out -type f -mtime -1 but now how to copy these files to some other directory one by one ... (1 Reply)
Discussion started by: sreenusola
1 Replies

10. UNIX for Dummies Questions & Answers

search files and copy them to a directory with datestamp attached to it

Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it. Iam using following command to search the files find $CA_OUT_PATH/*/ftp_out -type f -mtime -1 but now how to copy these files to some other directory one by one with... (1 Reply)
Discussion started by: sreenusola
1 Replies
Login or Register to Ask a Question