Daniel Doubrovkine bio photo

Daniel Doubrovkine

aka dB., @awscloud, former CTO @artsy, +@vestris, NYC

Email Twitter LinkedIn Github Strava
Creative Commons License

This is the last piece of the dev-ops puzzle. We want our MongoDB backup to run nightly. Let’s create a :cron task

task :cron => :environment do

We are going ot use whenever to avoid the ugly syntax of cron. Whenever is configured in config/schedule.rb.

set :output, "/tmp/cron_log.log"

every 1.day, :at => '3:30 am' do
  rake 'cron'

To propagate the settings to crontab, use the following command.

$ whenever --update-crontab

All credit for this one goes to @sarcilav – I wanted to wrap up our dev-ops story in one place on my blog.