{"id":13536391,"url":"https://github.com/jobbyphp/jobby","last_synced_at":"2026-04-05T17:37:45.957Z","repository":{"id":4925044,"uuid":"6081621","full_name":"jobbyphp/jobby","owner":"jobbyphp","description":"Manage all your cron jobs without modifying crontab. Handles locking, logging, error emails, and more.","archived":false,"fork":false,"pushed_at":"2024-03-29T11:33:54.000Z","size":230,"stargazers_count":1049,"open_issues_count":36,"forks_count":153,"subscribers_count":50,"default_branch":"master","last_synced_at":"2025-12-20T10:59:35.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/hellogerard/jobby","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"docker-library/wordpress","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jobbyphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-10-04T20:36:17.000Z","updated_at":"2025-10-16T08:15:53.000Z","dependencies_parsed_at":"2024-06-18T11:02:23.228Z","dependency_job_id":"c97ff68c-bd8f-40e7-8fe5-7920d500ff72","html_url":"https://github.com/jobbyphp/jobby","commit_stats":{"total_commits":194,"total_committers":41,"mean_commits":"4.7317073170731705","dds":0.768041237113402,"last_synced_commit":"a02846de7056fa648e299c9ba426e7f73a9e26cb"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/jobbyphp/jobby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobbyphp%2Fjobby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobbyphp%2Fjobby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobbyphp%2Fjobby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobbyphp%2Fjobby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jobbyphp","download_url":"https://codeload.github.com/jobbyphp/jobby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jobbyphp%2Fjobby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31444702,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T09:00:38.373Z","updated_at":"2026-04-05T17:37:45.921Z","avatar_url":"https://github.com/jobbyphp.png","language":"PHP","readme":"# Jobby, a PHP cron job manager #\n[![Total Downloads](https://img.shields.io/packagist/dt/hellogerard/jobby.svg)](https://packagist.org/packages/hellogerard/jobby)\n[![Latest Version](https://img.shields.io/packagist/v/hellogerard/jobby.svg)](https://packagist.org/packages/hellogerard/jobby)\n[![Build Status](https://img.shields.io/travis/jobbyphp/jobby.svg)](https://travis-ci.org/jobbyphp/jobby)\n[![MIT License](https://img.shields.io/packagist/l/hellogerard/jobby.svg)](https://github.com/jobbyphp/jobby/blob/master/LICENSE)\n\nInstall the master jobby cron job, and it will manage all your offline tasks. Add jobs without modifying crontab.\nJobby can handle logging, locking, error emails and more.\n\n**NEW REPO:** We have moved `jobby` to a Github org. Please update your remotes to `https://github.com/jobbyphp/jobby.git`.\n\n## Features ##\n\n- Maintain one master crontab job.\n- Jobs run via PHP, so you can run them under any programmatic conditions.\n- Use ordinary crontab schedule syntax (powered by the excellent [`cron-expression`](\u003chttps://github.com/dragonmantank/cron-expression\u003e)).\n- Run only one copy of a job at a given time.\n- Send email whenever a job exits with an error status. \n- Run job as another user, if crontab user has `sudo` privileges.\n- Run only on certain hostnames (handy in webfarms).\n- Theoretical Windows support (but not ever tested)\n\n## Getting Started ##\n\n### Installation ###\n\nThe recommended way to install Jobby is through [Composer](http://getcomposer.org):\n```\n$ composer require hellogerard/jobby\n```\n\nThen add the following line to your (or whomever's) crontab:\n```\n* * * * * cd /path/to/project \u0026\u0026 php jobby.php 1\u003e\u003e /dev/null 2\u003e\u00261\n```\n\nAfter Jobby installs, you can copy an example file to the project root.\n```\n$ cp vendor/hellogerard/jobby/resources/jobby.php .\n```\n\n### Running a job ###\n\n```php\n\u003c?php \n\n// Ensure you have included composer's autoloader  \nrequire_once __DIR__ . '/vendor/autoload.php';\n\n// Create a new instance of Jobby\n$jobby = new Jobby\\Jobby();\n\n// Every job has a name\n$jobby-\u003eadd('CommandExample', [\n\n    // Run a shell command\n    'command'  =\u003e 'ls',\n\n    // Ordinary crontab schedule format is supported.\n    // This schedule runs every hour.\n    'schedule' =\u003e '0 * * * *',\n\n]);\n\n$jobby-\u003erun();\n```\n\n## Examples ##\n\n### Logging ###\n\n```php\n\u003c?php\n\n/* ... */\n\n$jobby-\u003eadd('LoggingExample', [\n    \n    'command' =\u003e 'ls',\n    'schedule' =\u003e '0 * * * *',\n    \n    // Stdout and stderr is sent to the specified file\n    'output' =\u003e 'logs/command.log',\n\n]);\n\n/* ... */\n```\n\n### Disabling a command ###\n\n```php\n\u003c?php\n\n/* ... */\n\n$jobby-\u003eadd('DisabledExample', [\n    \n    'command' =\u003e 'ls',\n    'schedule' =\u003e '0 * * * *',\n    \n    // You can turn off a job by setting 'enabled' to false\n    'enabled' =\u003e false,\n\n]);\n\n/* ... */\n```\n\n### Running closures ###\n\nWhen running closures, beware that nothing outside of the closure is visible (see #93)!\n\n```php\n\u003c?php\n\n/* ... */\n\n$jobby-\u003eadd('ClosureCommandExample', [\n    \n     // Use the 'closure' key\n     // instead of 'command'\n    'closure' =\u003e function() {\n        echo \"I'm a function!\\n\";\n        return true;\n    },\n    \n    'schedule' =\u003e '0 * * * *',\n\n]);\n\n/* ... */\n```\n\n### Using a DateTime ###\n\n```php\n\u003c?php\n\n/* ... */\n\n$jobby-\u003eadd('DateTimeExample', [\n    \n    'command' =\u003e 'ls',\n    \n    // Use a DateTime string in\n    // the format Y-m-d H:i:s\n    'schedule' =\u003e '2017-05-03 17:15:00',\n\n]);\n\n/* ... */\n```\n\n### Using a Custom Scheduler ###\n\n```php\n\u003c?php\n\n/* ... */\n\n$jobby-\u003eadd('Example', [\n    \n    'command' =\u003e 'ls',\n    \n    // Use any callable that returns\n    // a boolean stating whether\n    // to run the job or not\n    'schedule' =\u003e function(DateTimeImmutable $now) {\n        // Run on even minutes\n        return $now-\u003eformat('i') % 2 === 0;\n    },\n\n]);\n\n/* ... */\n```\n\n## Supported Options ##\n\nEach job requires these:\n\nKey       | Type    | Description\n:-------- | :------ | :---------------------------------------------------------------------------------------------------------\nschedule  | string  | Crontab schedule format (`man -s 5 crontab`) or DateTime format (`Y-m-d H:i:s`) or callable (`function(): Bool { /* ... */ }`)\ncommand   | string  | The shell command to run (exclusive-or with `closure`)\nclosure   | Closure | The anonymous PHP function to run (exclusive-or with `command`)\n\n\nThe options listed below can be applied to an individual job or globally through the `Jobby` constructor. \nGlobal options will be used as default values, and individual jobs can override them.\n\nOption         | Type      | Default                             | Description\n:------------- | :-------- | :---------------------------------- | :-------------------------------------------------------- \nrunAs          | string    | null                                | Run as this user, if crontab user has `sudo` privileges\ndebug          | boolean   | false                               | Send `jobby` internal messages to 'debug.log'\n_**Filtering**_|           |                                     | _**Options to determine whether the job should run or not**_ \nenvironment    | string    | null or `getenv('APPLICATION_ENV')` | Development environment for this job\nrunOnHost      | string    | `gethostname()`                     | Run jobs only on this hostname\nmaxRuntime     | integer   | null                                | Maximum execution time for this job (in seconds)\nenabled        | boolean   | true                                | Run this job at scheduled times\nhaltDir        | string    | null                                | A job will not run if this directory contains a file bearing the job's name \n_**Logging**_  |           |                                     | _**Options for logging**_\noutput         | string    | /dev/null                           | Redirect `stdout` and `stderr` to this file\noutput_stdout  | string    | value from `output` option          | Redirect `stdout` to this file\noutput_stderr  | string    | value from `output` option          | Redirect `stderr` to this file\ndateFormat     | string    | Y-m-d H:i:s                         | Format for dates on `jobby` log messages\n_**Mailing**_  |           |                                     | _**Options for emailing errors**_\nrecipients     | string    | null                                | Comma-separated string of email addresses\nmailer         | string    | sendmail                            | Email method: _sendmail_ or _smtp_ or _mail_\nsmtpHost       | string    | null                                | SMTP host, if `mailer` is smtp\nsmtpPort       | integer   | 25                                  | SMTP port, if `mailer` is smtp\nsmtpUsername   | string    | null                                | SMTP user, if `mailer` is smtp\nsmtpPassword   | string    | null                                | SMTP password, if `mailer` is smtp\nsmtpSecurity   | string    | null                                | SMTP security option: _ssl_ or _tls_, if `mailer` is smtp\nsmtpSender     | string    | jobby@\u0026lt;hostname\u0026gt;              | The sender and from addresses used in SMTP notices\nsmtpSenderName | string    | Jobby                               | The name used in the from field for SMTP messages\n\n## Symfony integration ##\n\nSymfony bundle for Jobby - [imper86/jobby-cron-bundle](https://github.com/imper86/jobby-cron-bundle)\n\n## Credits ##\n\nDeveloped before, but since inspired by [whenever](\u003chttps://github.com/javan/whenever\u003e).\n\n[Support this project](https://cash.me/$hellogerard)\n","funding_links":[],"categories":["Back End","Table of Contents","目录","PHP","定时任务( Crontab )","任务运行器 Task Runners"],"sub_categories":["Task Runners","任务运行者 Task Runners"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobbyphp%2Fjobby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjobbyphp%2Fjobby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjobbyphp%2Fjobby/lists"}