Skip to content
Run cronjobs in distributed environments
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Run cronjobs in distributed environments


* * * * * /usr/bin/cronlock logKey ping
* * * * * cd /var/www/; /usr/bin/cronlock /usr/bin/php logKey test.php


  • logKey is a filename where the output of the cron will be saved
  • ping is the command that needs to be executed


  • LOCK_DIR and LOG_DIR must be a shared volume between the servers for this to work
  • LOG_DIR/last_successful_start file is created with the timestamp when the cron starts executing
  • LOG_DIR/last_successful_exit file is created when cron completes executing the command
You can’t perform that action at this time.