log rolling

Hi,

I'm thinking of running a script via cron (every hour) to do the log rolling.
The file is "file.txt" and there going to be 10 files rolling (file.txt.n).
The file is being written constantly by an application.
The script will do the following:

  1. cat file.txt > file.txt.0
  2. cat /dev/null >file.txt
  3. i=9
  4. while [ $i -ge 0 ]; do
    mv file.txt.$i file.txt.($i+1)
    i=$i-1
    done

What would be the possible issues w.r.t. file handling or loosing data ?

Thanks
Ch.