How can I monitor the size of a file? I run a particular abandoned open source project (StreamBaby) on my home media server, a Mac Mini.  It's awesome but has one unfortunate issue which occasionally causes the app to generate an absolutely massive error log - like on the order of many tens of gigabytes.  Sometimes by the time I notice it, it's well over 100GB.  All I have to do is delete it and restart the service and all is fine, but obviously problems can arise if the drive runs out of space due to this.

I'd like to monitor this file and any time it's larger than maybe 10MB, alert me in some fashion (beep, send an email, pop an alert... something).  I've found services that will monitor if a file size has changed, but I need to monitor it for a specific size.

Can this be done via Automator, AppleScript, or some other means?
If you don't actually need the content of the file, you could link it to /dev/null which means that anything written to the file will disappear immediately. To do so


quit the application
rm /path/to/logfile
ln -s /dev/null /path/to/logfile