An interesting post regarding how to use inotify and inotifywait as an alternative to a cron job to automate actions which have to be performed quite often (e.g. watermarking PDFs, static code analysis, analyzing rotate log files…): Automate your shell scripts using inotify and inotifywait