承接 bashaus/solo-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bashaus/solo-php

Composer 安装命令:

composer require bashaus/solo-php

包简介

Prevents multiple cron instances from running simultaneously

关键字:

README 文档

README

Prevents two of the same cronjobs from running at the same. It is useful with cron to make sure that a job doesn't run before a previous one has finished.

This script is a port of the original solo bash script written by Tim Kay. It has been ported to PHP to make it available on Windows servers.

Installation

Add the following to your composer.json.

{
    "require": {
        "bashaus/solo-php": "dev-master"
    },
    "config": {
        "bin-dir" : "bin"
    }
}

Usage

bin/solo [port] [exec*]
  • Argument port is an arbitrary port number to lock
  • Argument exec is a shell command to run

You can use it with cron like this:

* * * * * cd ...; bin/solo 24601 ./task.php arg1 arg2 arg3

The script task.php run every minute, but only if the previous invocation has finished. You can use any parameters, it doesn't have to run it every minute.

Further reading

Take a look at Tim Kay's documentation for more use cases and how to use solo.

Contributors

If you fork this project and create a pull request add your GitHub username, your full name and website to the end of list above.

统计信息

  • 总下载量: 2.91k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-12-06