i haven't used cron yet but now i want to use it and got some idea
about cron from google but not exactly..
so i want to use cron in ruby on rails application. in application i
want to fire some query everyday so where i should write the code for
query so that when cron is run that query is also fire??
Cron runs whatever you tell it too, wherever that is.
If you want to run something with the Rails app's environment, you
probably want to add the code to {RAILS_ROOT}/lib and invoke it
via {RAILS_ROOT}/script/runner
as you told to add the code to {RAILS_ROOT}/lib so you mean to say to
add the code in lib folder, i have to make one file with extension is
what?? and {RAILS_ROOT}/script/runner is the command which i should
run??
~/projects/example$ more lib/whatever.rb
class Whatever
class << self
def say_it
puts "it, that's all"
end
end
end
~/projects/example$ script/runner Whatever.say_it
it, that's all
~/projects/example$
i haven't used corn before so can you please tell me something in
detail??
Have you read the man pages for cron and crontab? That should be
enough examples to get you started, I'd think.
why you have given me this link??it is about man command for UNIX..
hi,
Which things are necessary for cron and crontab..i mean what i suppose
to do for that??
hi,
one day you told me to follow using following code:
~/projects/example$ more lib/whatever.rb
class Whatever
class << self
def say_it
puts "it, that's all"
end
end
end
~/projects/example$ script/runner Whatever.say_it
it, that's all
~/projects/example$
i made this file and add this method but don't i need to make a page for
say_it method?? how can i come to know that this cron is working i mean
where this message "it, that,s all" will display??
Did you take any effort to learn what cron is? Did you do Internet search? Anyway, I don’t think it’s anyway related to rails now, you need to read man pages for cron (available on Internet). And you will know what Kieran is trying to tell if you click on those links and read.