Whenever: Don't forget leading zeros for hours!
Whenever is a Ruby gem that provides a nicer syntax for writing and deploying cron jobs.
Leading zeros are important for whenever if you use the 24-hours format!
every 1.day, at: '3:00', roles: [:primary_cron] do runner 'Scheduler.delay.do_things' end
will lead to this crontab entry (
0 15 * * * /bin/bash -l -c 'cd /var/www/my-project/releases/20180607182518 && bin/rails runner -e production '\''Scheduler.delay.do_things'\'''
Which would run on 3pm instead of 3am.
Using the leading zero will lead to the expected behaviour:
every 1.day, at: '03:00', roles: [:primary_cron] do runner 'Scheduler.delay.do_things' end
0 3 * * * /bin/bash -l -c 'cd /var/www/my-project/releases/20180608095252 && bin/rails runner -e staging '\''Scheduler.delay.do_things'\'''
Your development team has a full backlog of feature requests, chores and refactoring coupled with deadlines? We are familiar with that. With our "DevOps as a Service" offering, we support developer teams with infrastructure and operations expertise.