{"id":15917554,"url":"https://github.com/takuya/cronjob-alternative","last_synced_at":"2026-04-08T14:05:36.683Z","repository":{"id":136550699,"uuid":"407472615","full_name":"takuya/cronjob-alternative","owner":"takuya","description":"Run cron with web ui","archived":false,"fork":false,"pushed_at":"2022-04-19T05:22:30.000Z","size":10390,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-26T15:10:35.875Z","etag":null,"topics":["cron","laravel","scheduling"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takuya.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,"zenodo":null}},"created_at":"2021-09-17T08:55:59.000Z","updated_at":"2024-02-01T01:04:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"4b915800-f6da-4726-86ac-be52086130d0","html_url":"https://github.com/takuya/cronjob-alternative","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/takuya/cronjob-alternative","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fcronjob-alternative","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fcronjob-alternative/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fcronjob-alternative/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fcronjob-alternative/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takuya","download_url":"https://codeload.github.com/takuya/cronjob-alternative/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fcronjob-alternative/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"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":["cron","laravel","scheduling"],"created_at":"2024-10-06T18:11:24.518Z","updated_at":"2026-04-08T14:05:36.678Z","avatar_url":"https://github.com/takuya.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Cron Job Alternative\n\n![Actions Status](https://github.com/takuya/cronjob-alternative/workflows/test%20src/badge.svg)\n\nCRONと同等の処理を、webから管理する\n\nLinuxのcrontabの定期実行の不便さを解消したい。\n\n## CronジョブをWEBから管理。\n\nCronのジョブをウェブから管理するためのパッケージ。\n\n## 画面\n\n### スケジュール一覧画面\n\u003cp align=\"center\"\u003e\n\u003cimg src=https://cdn-ak.f.st-hatena.com/images/fotolife/t/takuya_1st/20210917/20210917182425_original.png width=400/\u003e\n\u003c/p\u003e\n\n### cron ジョブ定義画面\n\u003cp align=\"center\"\u003e\n\n\u003cimg src='https://cdn-ak.f.st-hatena.com/images/fotolife/t/takuya_1st/20210917/20210917182720_original.png' width=400 /\u003e\n\u003c/p\u003e\n\n### cron ジョブの実行結果画面\n\u003cp align=\"center\"\u003e\n\n\u003cimg src='https://cdn-ak.f.st-hatena.com/images/fotolife/t/takuya_1st/20210917/20210917182531_original.png' width=400 /\u003e\n\u003c/p\u003e\n\n## インストール\n\nインストールは３つの手順です。\n- github レポジトリのclone\n- 初期設定\n- スケジューラー起動\n\n### github からの clone \nプロジェクトをコピーして、WEB領域に展開します。\n```\n## clone \ngit clone git@github.com:takuya/cronjob-alternative.git\ncd cronjob-alternative\n```\n## 初期設定\nlaravel の初期設定です。\n```\n## install depends\nphp composeer.phar install\nnpm i \nnpm run prod\n## initialize laravel\ncp .env.prod .env \ntouch database/database.sqlite\nphp  artisan storage:link\nphp  artisan migrate\n```\n### スケジューラーの起動\n\nスケジューラーを起動してcron実行。\n```\nsudo php artisan cron:work\n```\n\nworker をsudo(root)で動作させると、linuxのcron同じ権限で動作が可能です。\n\n## CRONジョブの登録\nCRONジョブは、コマンドから登録できます。\n\n#### cron ジョブの登録例\n```\nphp artisan schedule:cron_add '*/20 * * * *' 'my first cron' 'echo Hello world'\n```\n## 自動起動設定\n\nインストールと動作確認ができたら、systemd や hypervisordを使って自動起動させます。\n\n### systemd への登録\n\nsystemd 用の service unit ファイルを生成し、systemdに登録します。\n```\nsudo su \nphp artisan schedule:systemd_generate \u003e /etc/systemd/system/cron-laravel.servie\nsystemctl daemon-reload\nsystemct start cron-laravel\n```\n\n## docker での動作\n\n手軽に試せるように docker イメージを用意しました。\n\n### docker での起動サンプル\n\ndocker コンテナで動作サンプル\n```sh\ndocker pull ghcr.io/takuya/cronjob-alternative:latest\ndocker run --rm -p 5000:80 ghcr.io/takuya/cronjob-alternative:latest\n```\n(DockerHubではなく、github の ghcr.io を利用しています。)\n\ndocker起動時のデフォルトユーザー \n```\nusername: cron@example.com\npassword: 4jjXBxtRhUmrXBj\n```\n\n\n## このレポジトリについて。\n\n## cron との関係\n\nsystemd-cronや /etc/cron の更新はしません。cron 書式を解釈しスケジューラを自分で起動して実行します。\n\n## このソフトの特長\n\ncrontabの不便な点を解消したい。\n\n- 実行の一時停止。\n- WEBから編集と追加ができる。\n- 実行時のエラーログと正常ログを捨てずに保存。\n- 実行スケジュールを読みやすくしたい。\n- 実行するシェルスクリプトを複数行で書きたい\n- 実行ファイルを作成せずにスクリプト本文を書きたい。\n\n\u003cp\u003e\nLinuxのcron で実行すると、メール通知が鬱陶しくて標準出力とエラー出力を捨ててしまいがちです。しかしエラーが出てこないのは困ります。\nまた、何時何分に実行済みか、現在実行中なのかがわからずに困ります。\u003cbr\u003e\n　そこで、実行後に出力を保存して結果がわかるようにしました。また実行中の場合は実行中がわかるようにしました。\n\u003c/p\u003e\n\n\u003cp\u003e\ncron に書くスクリプトは、１ファイルにまとめるために、何が書かれているのかファイルを見ないとわからなくなります。\u003cbr\u003e\nそこで、cronジョブに名前をつけてコメント付記できるようにし、ファイルの本文を直接記述して実行できるようにしました。\n\u003c/p\u003e\n\n\u003cp\u003e\ncron のスクリプトを停止するコメントアウトでcrontab ファイルは読みにくくなります。\u003cbr\u003e\nそこで、実行を一時停止できるようにOn/Offを可能しました。\n\u003c/p\u003e\n\n\n## TODO:\n\n- 通知機能設定\n- 共通環境変数設定\n- ~~dockerビルド~~\n- ドキュメント\n\n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fcronjob-alternative","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakuya%2Fcronjob-alternative","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fcronjob-alternative/lists"}