tags:

views:

21

answers:

2

Hi, I have to run couple of scripts which crawl some 1000s web pages and save some information for every 10 minutes. I am using dreamhost shared hosting for my PHP site hosting.

What would be the appropriate way to configure these services in cron so that it executes 24X7. Please let me know which host i can use for the same.

A: 

If you can ssh into your server, you would need to run "crontab -e" to edit your cron jobs and then add a line like this:

*/10 * * * * path/to/ruby path/to/your/script.rb

Curtis Edmond
A: 

You could also checkout the rufus-scheduler gem which makes scheduling from ruby easy and painless. So for your need to do stuff every 10 minutes:

require 'rufus/scheduler'

scheduler = Rufus::Scheduler.start_new
scheduler.every '10m' do
 # do something
end
Himanshu