{"id":17383664,"url":"https://github.com/ujamii/update-cronjobs","last_synced_at":"2026-07-09T15:31:12.342Z","repository":{"id":57074883,"uuid":"171240815","full_name":"ujamii/update-cronjobs","owner":"ujamii","description":"Bash script to update the cronjobs of the current project (and only those)","archived":false,"fork":false,"pushed_at":"2019-02-18T08:31:50.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-13T08:04:57.045Z","etag":null,"topics":["cronjob","deployment","deployment-automation","shell","shell-script"],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/ujamii.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}},"created_at":"2019-02-18T08:07:19.000Z","updated_at":"2024-04-11T20:46:28.000Z","dependencies_parsed_at":"2022-08-24T14:55:38.256Z","dependency_job_id":null,"html_url":"https://github.com/ujamii/update-cronjobs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ujamii/update-cronjobs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fupdate-cronjobs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fupdate-cronjobs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fupdate-cronjobs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fupdate-cronjobs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ujamii","download_url":"https://codeload.github.com/ujamii/update-cronjobs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ujamii%2Fupdate-cronjobs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35304874,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"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":["cronjob","deployment","deployment-automation","shell","shell-script"],"created_at":"2024-10-16T07:43:25.984Z","updated_at":"2026-07-09T15:31:12.296Z","avatar_url":"https://github.com/ujamii.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"ujamii/update-cronjobs\n======================\n\nBash script to update the cronjobs of the current project and only those.  \n`update-cronjobs.sh` takes cronjobs via the standard input in normal crontab format\nand puts them in a special block without touching the already existing cronjobs in the cron file.\n\nThis allows you to build a script to automatically update your project cronjobs on deployment.  \nIf you are not the one deploying your application, you can just pass the system admin the name of\nthe script to execute to setup your cronjobs instead of having to tell him every single line that you want in your cronjobs file.  \n\nIf you put the script to update your cronjobs into your projects git / svn repository, you also suddenly have your cronjobs,\nincluding the time they should be executed, in version control, without installing big cron-like-behaviour bundles for your framework / cms. \n\nSetup with composer:\n--------------------\n\n```shell\ncomposer require ujamii/update-cronjobs\n```\n\n**Add a scripts/setupCronjobs.sh to your project:**\n\n```shell\n#!/usr/bin/env bash\n\nPROJECT_ROOT=$(cd $(dirname $0)/..; pwd -P)\nCRONJOBS_NAME='My great project'\n\n${PROJECT_ROOT}/vendor/ujamii/update-cronjobs/update-cronjobs.sh \"${CRONJOBS_NAME}\" $1 \u003c\u003c-EOF\n\t@daily      ${PROJECT_ROOT}/bin/console daily-cronjob-example\n\n\t# Send mails every 5 minutes\n\t*/5 * * * * ${PROJECT_ROOT}/bin/console sendmails\n\n\t# ... Your other cronjobs ...\nEOF\n```\n\nNow you can run `./scripts/setupCronjobs.sh` to update your project\ncronjobs without touching the other cronjobs already in the crontab.\n\n**This will result in the following crontab:**\n\n```shell\n#---- My great project cronjobs start here ----#\n@daily      bin/console daily-cronjob-example\n\n# Send mails every 5 minutes\n*/5 * * * * bin/console sendmails\n\n# ... Your other cronjobs ...\n#---- My great project cronjobs end here ------#\n```\n\nTo remove the whole block again, including the start and end markers,\ncall `./scripts/setupCronjobs.sh -r`  \nThis again won't affect the other cronjobs in the crontab and just\nremove the project block.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujamii%2Fupdate-cronjobs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fujamii%2Fupdate-cronjobs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fujamii%2Fupdate-cronjobs/lists"}