samedi 15 août 2015

How to test cronjob in ruby on rails in ubuntu

I create a cronjob in ruby on rails by using whenever gem and write a code in schedule.rb

set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"} every '* * * * * ' do command "puts 'you can use raw cron syntax too'" end

After that I update my crontab by command whenever --update-crontab

and restart

sudo service cron restart

and check by crontab -l

Begin Whenever generated tasks for: /home/haseebahmad/projects/social/config/schedule.rb

          • /bin/bash -l -c 'puts '\''you can use raw cron syntax too'\'' >> log/cron_log.log 2>> log/cron_error_log.log'

End Whenever generated tasks for: /home/haseebahmad/projects/social/config/schedule.rb

But it doesn't work meanz cronjo doesn't work.How can I test it?

Aucun commentaire:

Enregistrer un commentaire