PHPackages                             visavi/crontask - 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. visavi/crontask

ActiveLibrary

visavi/crontask
===============

Simple PHP cron tasks

v2.0.0(5y ago)817.7k↓37%12MITPHPPHP &gt;=7.2CI failing

Since Oct 20Pushed 5y ago1 watchersCompare

[ Source](https://github.com/visavi/crontask)[ Packagist](https://packagist.org/packages/visavi/crontask)[ Docs](https://visavi.net)[ RSS](/packages/visavi-crontask/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (2)

Cron tasks
==========

[](#cron-tasks)

[![Total Downloads](https://camo.githubusercontent.com/8fb1100d807ee813cd4b5fcc62e27c22c2b892256fdbb475f291a7624a0fd814/68747470733a2f2f706f7365722e707567782e6f72672f7669736176692f63726f6e7461736b2f646f776e6c6f616473)](https://packagist.org/packages/visavi/crontask)[![Latest Stable Version](https://camo.githubusercontent.com/902742ce14e91890b8aa4376d16de02af2d6df791462210b5821d5543f631f27/68747470733a2f2f706f7365722e707567782e6f72672f7669736176692f63726f6e7461736b2f762f737461626c65)](https://packagist.org/packages/visavi/crontask)[![Latest Unstable Version](https://camo.githubusercontent.com/8d089938944458aa55937983ef51086911634a7df48063dfea047429ee6e30be/68747470733a2f2f706f7365722e707567782e6f72672f7669736176692f63726f6e7461736b2f762f756e737461626c65)](https://packagist.org/packages/visavi/crontask)[![License](https://camo.githubusercontent.com/6374eafae96ec04674ca3da20770467c522e6bbeb81b5ba3eae1c98862066f1f/68747470733a2f2f706f7365722e707567782e6f72672f7669736176692f63726f6e7461736b2f6c6963656e7365)](https://packagist.org/packages/visavi/crontask)

Introduction
------------

[](#introduction)

This package contains a simple PHP cron task scheduler that helps you version control your cron jobs.

Requirements
------------

[](#requirements)

This library package requires PHP 7.0 or later

Installation
------------

[](#installation)

### Installing via Composer

[](#installing-via-composer)

The recommended way to install crontask is through [Composer](http://getcomposer.org).

Next, run the Composer command to install the latest version of crontask:

```
composer require visavi/crontask
```

After installing, you need to require Composer's autoloader:

```
require 'vendor/autoload.php';
```

Once you've created your task list script (see Usage below) open a linux shell add the following line to crontab (crontab -e):

```
* * * * * php /path/cron.php

```

Usage
-----

[](#usage)

The following example shows how to schedule a HelloDaily task (simple echo example) and a ShellMonday task (running a shell task example).

```
class HelloDailyTask extends \Crontask\Tasks\Task
{
    public function run()
    {
        $this->setOutput('Hello World');
    }
}

class ShellMondayTask extends \Crontask\Tasks\Shell
{
    protected $command = "echo Hello Monday";
}

$taskList = new \Crontask\TaskList();

// Add task to run at 12:00 every day
$taskList->addTask((new HelloDailyTask)->setExpression('12 0 * * *'));

// Add task to run every hour
$taskList->addTask((new HelloDailyTask)->setExpression('@hourly'));

// Add task to run at 12:00 every Monday
$taskList->addTask((new ShellMondayTask)->setExpression('12 0 * * 1'));

// or
$taskList->addTasks([
    (new HelloDailyTask)->setExpression('12 0 * * 1'),
    (new HelloDailyTask)->setExpression('@hourly'),
    (new ShellMondayTask)->setExpression('12 0 * * 1'),
]);

$taskList->run();
```

CRON Expressions
----------------

[](#cron-expressions)

A CRON expression is a string representing the schedule for a particular command to execute. The parts of a CRON schedule are as follows:

```
*    *    *    *    *
-    -    -    -    -
|    |    |    |    |
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
|    |    |    +---------- month (1 - 12)
|    |    +--------------- day of month (1 - 31)
|    +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)

```

Mappings
--------

[](#mappings)

```
@yearly   => 0 0 1 1 *
@annually => 0 0 1 1 *
@monthly  => 0 0 1 * *
@weekly   => 0 0 * * 0
@daily    => 0 0 * * *
@hourly   => 0 * * * *

```

### License

[](#license)

The class is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~434 days

Total

4

Last Release

1829d ago

Major Versions

v1.2.0 → v2.0.02021-05-15

PHP version history (2 changes)v1.0PHP &gt;=7.0

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/826831?v=4)[Alexander Grigorev](/maintainers/visavi)[@visavi](https://github.com/visavi)

---

Top Contributors

[![visavi](https://avatars.githubusercontent.com/u/826831?v=4)](https://github.com/visavi "visavi (11 commits)")

---

Tags

croncrontabphpschedulertaskphpschedulercrontaskcrontab

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/visavi-crontask/health.svg)

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

###  Alternatives

[jmose/command-scheduler-bundle

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

3361.4M1](/packages/jmose-command-scheduler-bundle)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4037.1k4](/packages/orisai-scheduler)[rewieer/taskschedulerbundle

Task Scheduler with CRON for Symfony

63242.1k](/packages/rewieer-taskschedulerbundle)[guikingone/scheduler-bundle

A Symfony bundle that allows to schedule and create repetitive tasks

114217.4k](/packages/guikingone-scheduler-bundle)[dukecity/command-scheduler-bundle

This Symfony bundle will allow you to schedule all your commands just like UNIX crontab

25350.9k5](/packages/dukecity-command-scheduler-bundle)[pmill/php-scheduler

Simple PHP task scheduler

1833.5k](/packages/pmill-php-scheduler)

PHPackages © 2026

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