in reply to automated file move

Under Linux you can use the fuser command to determine if another process has the file open. That would be another useful piece of information to use in your determination of whether or not the log file is still being written to.

I'm sure there is something equivalent for Windows. You can also use the fact that some Windows commands don't let you rename files which are open or rename directories which have open files under them them. Don't know what they are, but I run into that problem all the time using the Windows Explorer.