The whenever is a gem that allows you to write cron jobs easily.
every 2.hours do command "mysqldump db > db.sql" end
every :day, :at => '12:20am' do command "mysqldump db > db.sql" end
whenever: command not found
whenever: command not found error is shown whenever the
whenever gem is not installed or cannot be seen
$ whenever whenever: command not found
$ gem list | grep whenever
The thing since we almost always use bundler, you should use the bundle exec command:
$ bundle show whenever /home/myapp/vendor/bundle/ruby/2.2.2/gems/whenever-0.9.2
So running whenever commands would be:
$ bundle exec whenever 0 0,12 * * * /bin/bash -l -c 'mysqldump -u username -p password database_name | bzip2 -c > backup_$(date +\%Y-\%m-\%d-\%H.\%M.\%S).sql.bz2'
$ bundle exec whenever -w [write] crontab file written