Copying one file at a time from one directory to another directory.


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying one file at a time from one directory to another directory.
# 1  
Old 09-01-2008
Copying one file at a time from one directory to another directory.

Hi All

i want to write a script which could copy one file at a time from one directory to another directory.

Scenerio:
Let's say i have 100 file in a dirctory,so i want to copy one file at a time to another directory with a sleep statement in between that of 30 secs.

please help me regarding this.

With Regards
Nikhil C.Indurkar
# 2  
Old 09-01-2008
Have you tried anything??
Assuming that file_list containing the list of files

Code:
while read line
do
cp $line to new_dir/$line
sleep 30
done<file_list

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Copying driver file from cd to directory

Hello. We've had quite a lot of issues with networking with our IBM server running SCO OpenServer 5.0.7. I figured it couldn't hurt to try installing a new network card in the server and see what results I get. When I go into netconfig I can see there's a fairly long list of network adapters... (1 Reply)
Discussion started by: hometrics
1 Replies

2. Shell Programming and Scripting

Copying files to a directory, renaming it if a file with the same name already exists

Hi All, I need to copy files from one directory to another with the files to be renamed while copying if a file with the same name already exists in the target directory. THanks, Dev (2 Replies)
Discussion started by: dev.devil.1983
2 Replies

3. Shell Programming and Scripting

How to preserve time stamp while copying a directory from Server B to Server A?

Experts, Please help me out here. How to preserve time stamp while copying a directory from Server B to Server A (3 Replies)
Discussion started by: ahmed.vaghar
3 Replies

4. Shell Programming and Scripting

Perl : copying only the latest file to other directory

In linux.. In a directory there are 3 files which I want to copy only the latest file (ls -ltr myfiles*.txt|tail -1) to other directory in perl? Could anyone please help me with the code? Regards, J (1 Reply)
Discussion started by: scriptscript
1 Replies

5. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

6. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

7. UNIX for Dummies Questions & Answers

No such file or directory error while copying files

Hi, I need to copy files from one dir to another dir. The list of filesnames to be moved are in a file called files2cp.log Script: #!/bin/ksh exec 0</home/amdocs/files2cp.log while read LINE do cp -i /iccs33/attach/"$LINE" /iccs30/attach/"$LINE" done The output is "No such... (6 Replies)
Discussion started by: srinirsr
6 Replies

8. UNIX for Dummies Questions & Answers

script copying the directory (or file) from server to my pc

Hello, I'm trying to create the shell script that: copy (or transfer) the directory from the unix server to my external hard drive (or hard drive) I've been serching this kind of thread here, but no luck so far. anyone can help me? Thank you. (2 Replies)
Discussion started by: myjwjw
2 Replies

9. UNIX for Dummies Questions & Answers

copying a file from one directory to another

Hi This is my first day in Unix, and I am trying to copy a file called holiday.txt from my D drive into the C drive folder called h like currently i am in D drive, i want to copy my holiday.txt into C\h (C drive, h folder) i am able to copy the file in the same drive, but how to do the... (5 Replies)
Discussion started by: soujanya_srk
5 Replies

10. UNIX for Dummies Questions & Answers

Copying file names returned from a grep command into another directory

When I do the following : grep -l "string" *, I get a list of file names returned. Is there a way to copy the files returned from the list into another directory ?. Thanks. (4 Replies)
Discussion started by: Kartheg
4 Replies
Login or Register to Ask a Question