Quote:
Originally Posted by Kumail_08
How can I cp n number of file at one time and then again other n number files second time after 5 min of sleep and so on and once all file get copied it start with the first n number of file again
|
something like this my function works, the loop you have to modify to get it to work, maybe even use a different type of loop. you have to figure out what files you are going to copy and how, keeping same name different location, or a different name different location, different name same location, or...
Code:
#!/bin/bash
# takes in number of times you want script to run on the command line
function rst(){
if [[ convertN -lt runTime ]]; then
echo " you forgot to enter an amount to resample"
ConvertNum=0
exit 1
else
ConvertNum=$((convertN))
return $ConvertNum #pass the var to space land
fi
}
rst
while [[ $cpAmountFiles -ne $ConvertNum ]] ;
do
cp -v /path/file /path/file
((cpAmountFiles++))
sleep 5
done
Code:
cp -v file1 file2 file3 file4 file5 /location/
#or
find /path/to/old/dir -name "file1" -o -name "file2" -exec cp {} /path/to/new/dir \;
#or
cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/
or all the many other ways to copy more then one file at a time.