{"id":20619674,"url":"https://github.com/mybuilder/cronos","last_synced_at":"2025-09-09T12:46:23.392Z","repository":{"id":11252386,"uuid":"13651868","full_name":"mybuilder/cronos","owner":"mybuilder","description":"A PHP component for updating crontab","archived":false,"fork":false,"pushed_at":"2024-04-13T12:26:09.000Z","size":85,"stargazers_count":153,"open_issues_count":4,"forks_count":14,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-08-06T23:56:48.211Z","etag":null,"topics":["cron","php","php-library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mybuilder.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2013-10-17T14:46:16.000Z","updated_at":"2025-01-04T20:04:53.000Z","dependencies_parsed_at":"2024-06-18T15:26:42.956Z","dependency_job_id":"67392a56-dc4d-4d90-ac4c-5c2e38f5b30a","html_url":"https://github.com/mybuilder/cronos","commit_stats":{"total_commits":69,"total_committers":17,"mean_commits":"4.0588235294117645","dds":0.7246376811594203,"last_synced_commit":"1019a39d80b4e5b1d6e0498d9c166783ee6bf426"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/mybuilder/cronos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybuilder%2Fcronos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybuilder%2Fcronos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybuilder%2Fcronos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybuilder%2Fcronos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mybuilder","download_url":"https://codeload.github.com/mybuilder/cronos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mybuilder%2Fcronos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274297403,"owners_count":25259056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cron","php","php-library"],"created_at":"2024-11-16T12:12:15.764Z","updated_at":"2025-09-09T12:46:23.334Z","avatar_url":"https://github.com/mybuilder.png","language":"PHP","readme":"# Cronos\n\nEasily configure cron through PHP.\n\nIf you use Symfony 4/5/6, you could use our [cool bundle](https://github.com/mybuilder/cronos-bundle) in order to configure your app jobs through fancy annotations!\n\n## Setup and Configuration\n\nRequire the library via composer:\n\n    composer require mybuilder/cronos\n\n## Usage\n\n### Build Cron\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\n$cron = new MyBuilder\\Cronos\\Formatter\\Cron;\n$cron\n    -\u003eheader()\n        -\u003esetPath('path')\n        -\u003esetHome('home')\n        -\u003esetMailto('test@example.com')\n        -\u003esetShell('shell')\n        -\u003esetContentType('text')\n        -\u003esetContentTransferEncoding('utf8')\n    -\u003eend()\n    -\u003ecomment('Comment')\n    -\u003ejob('/bin/bash command --env=dev')\n        -\u003esetMinute(1)\n        -\u003esetHour(2)\n        -\u003esetDayOfMonth(3)\n        -\u003esetMonth(4)\n        -\u003esetDayOfWeek(5)\n        -\u003esetStandardOutFile('log')\n        -\u003eappendStandardErrorToFile('error')\n    -\u003eend();\n\necho $cron-\u003eformat();\n```\n\nThat will print\n\n    MAILTO=test@example.com\n    HOME=home\n    SHELL=shell\n    LOGNAME=logName\n    CONTENT_TYPE=text\n    CONTENT_TRANSFER_ENCODING=utf8\n\n    #Comment\n    1    2    3    4    5    /bin/bash command --env=dev \u003e log 2\u003e\u003e error\n\n### Updating Cron\n\n```php\n\u003c?php\n\nrequire 'vendor/autoload.php';\n\nuse MyBuilder\\Cronos\\Formatter\\Cron;\nuse MyBuilder\\Cronos\\Updater\\CronUpdater;\n\n$cron = new Cron;\n// $cron configuration...\n\n$cronUpdater = CronUpdater::createDefault();\n$cronUpdater-\u003ereplaceWith($cron);\n```\n\n## Troubleshooting\n\n* The current user must have a existing crontab file to use the updater, use `crontab -e` to create one.\n* When a cron line is executed it is executed with the user that owns the crontab, but it will not execute any of the users default shell files so all paths etc need to be specified in the command called from the cron line.\n* Your crontab will not be executed if you do not have usable shell in `/etc/passwd`\n* If your jobs don't seem to be running, check the cron daemon is running, also check your username is in `/etc/cron.allow` and not in `/etc/cron.deny`.\n* Environmental substitutions do not work, you cannot use things like `$PATH`, `$HOME`, or `~/sbin`.\n* You cannot use `%` in the command, if you need to use it, escape the command in backticks.\n\n---\n\nCreated by [MyBuilder](http://www.mybuilder.com/) - Check out our [blog](http://tech.mybuilder.com/) for more insight into this and other open-source projects we release.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybuilder%2Fcronos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmybuilder%2Fcronos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmybuilder%2Fcronos/lists"}