PHPackages                             pnixx/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. pnixx/crontab

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

pnixx/crontab
=============

Provides a clear syntax for writing and deploying cron jobs

1.0.3(1y ago)03.0k↓33.3%1MITPHPPHP &gt;=7.1

Since May 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/PNixx/crontab-php)[ Packagist](https://packagist.org/packages/pnixx/crontab)[ RSS](/packages/pnixx-crontab/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Crontab PHP
===========

[](#crontab-php)

Crontab for PHP provides a clear syntax for writing and deploying cron jobs (inspired by [whenever](https://github.com/javan/whenever)).

### Installation

[](#installation)

```
$ composer require pnixx/crontab
```

### Usage

[](#usage)

```
use PNixx\Crontab\Crontab;
use PNixx\Crontab\Job;

//Initialize constructor
$crontab = new Crontab('example.com', '/path/to/example.com');

//Add job for run every minute
$job = new Job('bin/console hello');
$crontab->add($job);

//Add job for run hourly
$job = new Job('bin/console update');
$job
  ->setTime(Job::HOURLY)
  ->setLogFile('logs/execute.log');
$crontab->add($job);

//Add job for run custom time
$job = new Job('rm -Rf /var/cache');
$job->setTime('15 * * * *');
$crontab->add($job);

//Add job for run every two minutes
$job = new Job('echo "Hello World!"');
$job->setMinute('*/2');
$crontab->add($job);

//Update crontab
$crontab->update();
```

Result append or replace block to your crontab:

```
#===BEGIN Crontab for project: example.com
* * * * * cd /path/to/example.com && bin/console hello

0 * * * * cd /path/to/example.com && bin/console update >> /path/to/example.com/logs/execute.log

15 * * * * cd /path/to/example.com && rm -Rf /var/cache

*/2 * * * * cd /path/to/example.com && echo "Hello World!"

#===END Crontab for project: example.com

```

### Capistrano\\Symfony integration

[](#capistranosymfony-integration)

See on [Capistrano::Symfony documentation](https://github.com/capistrano/symfony) plugin for reference.

Symfony 3 command class for generation crontab

```
use PNixx\Crontab\Crontab;
use PNixx\Crontab\Job;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class CrontabUpdateCommand extends ContainerAwareCommand
{

    public function configure()
    {
        $this->setName('crontab:update');
        $this->setDescription('Update all cron tasks for project');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $root_path = realpath($this->getContainer()->get('kernel')->getRootDir() . '/..');

        //Initialize constructor crontab for current environment
        $crontab = new Crontab($this->getContainer()->get('kernel')->getEnvironment(), $root_path);

        //Add your jobs
        $crontab->add(new Job('echo "Hello World!"'));

        //Update
        $crontab->update();
    }
}
```

Add the following to `deploy.rb` for Capistrano '~&gt; 3.5'

```
namespace :deploy do
  task :crontab do
    on roles(:db) do
      invoke 'symfony:console', 'crontab:update', '--no-interaction'
    end
  end
end

after 'deploy:published', 'deploy:crontab'
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

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 ~1012 days

Total

4

Last Release

621d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5.0

1.0.3PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/02c8f1735bd7e79c5c23264f6339c560683685f8ec5b6090eb950e50bb7f486d?d=identicon)[PNixx](/maintainers/PNixx)

---

Top Contributors

[![PNixx](https://avatars.githubusercontent.com/u/1117351?v=4)](https://github.com/PNixx "PNixx (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[maize-tech/laravel-markable

Laravel Markable

755229.4k](/packages/maize-tech-laravel-markable)

PHPackages © 2026

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