
Sometimes it contains a PID, sometimes a timestamp or just plain empty. To prevent bad things from happening, a good rule of thumb is to always use a lockfileĪ lockfile is a small file, it virtually takes up no space, at least so little you won’t care (The actual size depends on your filesystem). This can result in data corruption or deletion of data that should not have been deleted, all depending on what the cronjob is set up to do

You may have experienced it before, you create a cronjob to change some data every X hour or minutes and one day this job takes longer than it usually does and cron spawns another job before the first one is finished.
