Hi folks! My rails app is deployed to several machines. I need each machine to run different cron jobs (it will be a disaster if they all run the job). How do i tell my script which machine it is currently on?
I am using the whenever gem, and i am thinking of adding the condition in the schedule.rb
Example:
My deploy/production.rb
role :memcache, "123.compute-1.amazonaws.com"
role :web, "456.compute-1.amazonaws.com"
role :db, "789.amazonaws.com"
role :misc, "789.amazonaws.com"
What I need to do:
if machine is db, email report every day on db capacity
if machine is xxx, do xxx...