Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cronjobs #8

Merged
merged 2 commits into from
Nov 1, 2013
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Cron jobs are not application dependant, moved the location of the cr…
…on_jobs in the custom JSON.
  • Loading branch information
onema committed Nov 1, 2013
commit 28aa032beeea52ae67274f00162d99eeedbda74c
84 changes: 39 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,51 +50,45 @@ Default will create multiple cronjobs based on the following configuration value
```
{
"custom_env": {
"staging_site": {
"cron_jobs": [
{
// Send an email every sunday at 8:10
"name": "send_email_sunday_8",
"minute": "10",
"hour": "8",
"month" : "*",
"weekday": "6",
"command": "cd /srv/www/staging_site/current && php .lib/mailing.php"
},
{
// Run at 8:00 PM every weekday Monday through Friday ONLY in November.
Notice there is no day
"name": "run_at_20h_nov",
"minute": "0",
"hour": "20",
"month": "10",
"weekday": "1-5",
"command": "cd /srv/www/staging_site/current && php app/console command:start:jobs"
}
]
},
"production_site": {
"cron_jobs": [
{
// Run Every 12 Hours - 1AM and 1PM
"name": "run_every_12h",
"minute" : "*",
"hour": "1-13",
"month" : "*",
"weekday" : "*",
"command": "cd /srv/www/production_site/current && php app/console hello:world"
},
{
// Run every 15 minutes
"name": "do_something_stupid_every_15m",
"minute": "15",
"hour" : "*",
"month" : "*",
"weekday" : "*",
"command": "cd /srv/www/production_site/current && php app/console memory:leak"
},
]
}
"cron_jobs": [
{
// Send an email every sunday at 8:10
"name": "send_email_sunday_8",
"minute": "10",
"hour": "8",
"month" : "*",
"weekday": "6",
"command": "cd /srv/www/staging_site/current && php .lib/mailing.php"
},
{
// Run at 8:00 PM every weekday Monday through Friday ONLY in November.
Notice there is no day
"name": "run_at_20h_nov",
"minute": "0",
"hour": "20",
"month": "10",
"weekday": "1-5",
"command": "cd /srv/www/staging_site/current && php app/console command:start:jobs"
},
{
// Run Every 12 Hours - 1AM and 1PM
"name": "run_every_12h",
"minute" : "*",
"hour": "1-13",
"month" : "*",
"weekday" : "*",
"command": "cd /srv/www/production_site/current && php app/console hello:world"
},
{
// Run every 15 minutes
"name": "do_something_stupid_every_15m",
"minute": "15",
"hour" : "*",
"month" : "*",
"weekday" : "*",
"command": "cd /srv/www/production_site/current && php app/console memory:leak"
},
]
}
}
```
Expand Down
4 changes: 1 addition & 3 deletions cronjobs/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
node[:deploy].each do |application, deploy|

node[:custom_env][application.to_s][:cron_jobs].each do |cron_values|
node[:custom_env][:cron_jobs].each do |cron_values|
cron "#{cron_values[:name]}" do
minute "#{cron_values[:minute]}"
hour "#{cron_values[:hour]}"
Expand All @@ -10,4 +9,3 @@
command "#{cron_values[:command]}"
end
end
end