PHPackages                             pcrumm/crony - 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. pcrumm/crony

ActiveLibrary

pcrumm/crony
============

PHP-based cron manager

121PHP

Since Oct 5Pushed 10y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Crony
=====

[](#crony)

`Crony` is a PHP-based cron job framework. Add the master task to your crontab, and `Crony` will take care of all of the work necessary to ensure that your offline jobs run how you want them, when you want them.

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

[](#installation)

1. Install [`composer`](http://getcomposer.org).
2. Add `Jobby` to `composer.json`.

    `"pcrumm/crony": "dev-master"`
3. Run `composer install`
4. Add the following to your crontab (see below for an example `jobs.php`:

    `* * * * * cd /path/to/project && php jobs.php 1>> /dev/null 2>&1`

Usage
-----

[](#usage)

### jobs.php

[](#jobsphp)

`jobs.php` loads and runs Crony tasks, and should be referrenced from your crontab. It should include a call to the `Crony::init()` method, which takes a single argument: the namespace that your tasks reside under. This namespace should be [PSR-0 autoloaded by composer](https://getcomposer.org/doc/01-basic-usage.md#autoloading), and by convention should exist in the `src` directory in your project's root. In the example below, all jobs are sub-directories of the `src/PhilCrumm/ExampleTasks` directory and thus exist in the `\PhilCrumm\ExampleTasks` namespace.

```
