Это старая версия документа!


flock

Простая защита от двойного запуска заданий cron

  • -s –shared Get a shared lock
  • -x –exclusive Get an exclusive lock
  • -u –unlock Remove a lock
  • -n –nonblock Fail rather than wait
  • -w –timeout Wait for a limited amount of time
  • -o –close Close file descriptor before running command
  • -c –command Run a single command string through the shell
* * * * * /usr/bin/flock --lockfile=/tmp/myapp.locked -- /path/to/myapp