hgg/crond

Manage crontab files in /etc/cron.d

v1.2.0 2013-04-03 19:31 UTC

README

Simple library for managing small crontab files in /etc/cron.d.

Installation

Using Composer:

{
    "require": {
        "hglattergotz/crond": "*"
    }
}

Usage

<?php
use HGG\Crond\Job;
use HGG\Crond\Crond;

$job = new Job();
$job->setUser('root');
$job->setCmd('/path/to/do/something/awesome');
$job->setTime('0 * * * *');
$job->setFileName('myCronJob');

$cron = new Crond();
$cron->install($job);

The above will install the cron job

0 * * * * root /path/to/do/something/awesome

in a file located at

/etc/cron.d/myCronJob