On Tue, 21 Dec 1999, Ray Olszewski wrote:

> This approach assumes the time spend doing the copying is negligible
> (because it waits 20 seconds from the *end* of a copy to the *beginning* of
> the next copy). Copying speed depends on the size of the file, system load,
> speed of the filesystem hardware, etc. -- way too many variables to make
> that assumption. Richard's similar script, which I saw after this one, has
> the same limitation.
> 
if  you want to be sure :

while true
do
   if [ -d /tmp/$$.lck ]
   then
      echo "still copying"
   else  
      (mkdir /tmp/$$.lck ; cp $1 $2 ;rmdir /tmp/$$.lck) &
   fi
   sleep 20
done

That should be more or less reliable, even for large copies (it might
skipp a copy if the previous one is not done.

Frank

> Also, you want an infinite loop, not 2000 repetitions ... as illustrated in
> Richard's suggestion.
> 
> At 09:40 AM 12/21/99 -0500, Paul Lee wrote:
> >maybe writing simple shell like this?
> >
> >set i = 0
> >while ($i < 2000)
> >cp $1 > $2
> >sleep 20
> >@ i++
> >end
> 
> ------------------------------------"Never tell me the odds!"---
> Ray Olszewski                                        -- Han Solo
> Palo Alto, CA                                  [EMAIL PROTECTED]        
> ----------------------------------------------------------------
> 
> 

HI! I'm a .signature virus! cp me into your .signature file to help me spread!

Reply via email to