adapt cron and write lock file when cron is running