I have a cron job that kicks off a new process every day. The process runs every 5 minutes and appends to a log file.
Another cron job runs every 60 minutes. It takes some of the data in the log file, cleans it up, creates a new log file. This cleaned up log file gets imported into a database. MySQL prevents duplicate entries so the first few lines of each new clean log file gets ignored.
At the end of a day, I'm stuck with 24 cleaned up log files and one raw log file.
If I was to run the clean-up script by first renaming the file to pre-process, do what I need to do, then delete it, would it cause any issues with my first cron script that is logging to the same file every 5 minutes?
My fear is that the original log file is being written to and this other cron task is trying to rename it.
OS: Debian 8
Edit: Interesting. Cron will write to the renamed file.