3

Before you read this, understand that I am completely new to the idea of a cron so this is difficult for me. I bundle installed the gem whenever. then i ran

wheneverize .

no errors. the schedule.rb was created. I have a file called scheduled_scrape.rb when i run

ruby script/scheduled_scrape.rb

it works perfectly fine. I put in my schedule.rb these lines

every 1.minutes do
   command "ruby script/scheduled_scrape.rb" #later on it'll be half an hour, 
   #i just need to test here
end

this does nothing. I dug around, and found that perhaps this should be called in terminal (i guess to activate it?)

whenever --update-crontab store

now, this is still doing nothing. What do i need to do to regularly call my scheduled_scrape.rb

Kevin
  • 1,574
  • 4
  • 19
  • 45

3 Answers3

0

Please check the generated cron job(something like /bin/bash -l....) by issuing the command "crontab -e" from terminal and try to run the generated command for cron job to check whether it works. If it is not working, try to change the option of the cron job from -l to -i(something like /bin/bash -i....). Now update the crontab and check whether it works.

vikram
  • 423
  • 4
  • 19
0

You can use whenever -i is the same as whenever --update-crontab.

For more info you can check the help with whenever -help.

You can check your cronjobs with the command crontab -l

roxdurazo
  • 745
  • 10
  • 21
0

If store is the name of your application, then the command should work. So just make sure you call it correctly:

whenever --update-crontab <your-app-name>
Marek Příhoda
  • 11,108
  • 3
  • 39
  • 53