I am trying to set a cron job with the help of whenever gem in my Opswork Ruby on Rails App.
I have found these instructions as a whenever recipe, but since I don't know much about Chef I am a little bit lost.
The suggested code:
Just include whenever in your node's run_list:
{
"name":"my_node",
"run_list": [
"recipe[whenever]"
]
}
I was adding it in the layer settings as a custom JSON but I get an error when I try to deploy:
ERROR: please set the node's run list using the 'run_list' attribute only.
I'm defining my cron job as follows:
#config/schedule.rb
env :PATH, '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/opt/aws/bin'
every 1.day, :at => '4:30 am' do
runner "UserMailer.mailgun.deliver"
end
I have added whenever::deploy
to my recipes under the layer settings as suggested here and the update cookbooks
command was successful, but when I tried to deploy I had an error stating whenever
recipe was not found
How should I set whenever or the cronjob in order to run in AWS?