PHPackages                             lvinkim/crontab - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lvinkim/crontab

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lvinkim/crontab
===============

v0.1.0(7y ago)02.0kPHPPHP ^7.1

Since Nov 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lvinkim/crontab)[ Packagist](https://packagist.org/packages/lvinkim/crontab)[ RSS](/packages/lvinkim-crontab/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

crontab
=======

[](#crontab)

crontab 定时任务

安装
--

[](#安装)

```
$ composer require lvinkim/crontab

```

### 使用说明

[](#使用说明)

##### 1. 配置文件

[](#1-配置文件)

```
$ vi /var/www/html/crontab.ini

[worker:1]
schedule = "* * * * *"
command = "/usr/bin/env php /var/www/html/tests/jobs/job-1.php"
enabled = 0

[worker:2]
schedule = "*/2 * * * *"
command = "/usr/bin/env php /var/www/html/tests/jobs/job-2.php"
enabled = 1

[worker:3]
schedule = "*/3 * * * *"
command = "/usr/bin/env php /var/www/html/tests/jobs/job-3.php"
enabled = 1

```

##### 2. 编写计划任务脚本

[](#2-编写计划任务脚本)

```
$ vi /var/www/html/crontab.php

use Lvinkim\Crontab\Crontab;

require dirname(__DIR__) . "/../vendor/autoload.php";

$configPath = dirname(__DIR__) . "/config/crontab.ini";

$crontab = new Crontab($configPath);
$crontab->run(60 * 1000);   // 每 60 秒

```

#### 3. 执行计划任务脚本

[](#3-执行计划任务脚本)

```
$ php /var/www/html/crontab.php

```

#### 4. 配置说明

[](#4-配置说明)

```
schedule : 与 linux 的 crotab 一致
command : 要执行的 shell 命令
enabled : 此配置是否生效，1 表示按计划执行， 0 表示暂停使用

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2749d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/01d0ca591c3a6b31fb49935eb9ef6c2556ac5f1d44057d207fd06a5316b45457?d=identicon)[lvinkim](/maintainers/lvinkim)

### Embed Badge

![Health badge](/badges/lvinkim-crontab/health.svg)

```
[![Health](https://phpackages.com/badges/lvinkim-crontab/health.svg)](https://phpackages.com/packages/lvinkim-crontab)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
