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??
On Sat, Sep 19, 2009 at 12:33 AM, Preksha P. [email protected] wrote:
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
On Sat, Sep 19, 2009 at 12:33 AM, Preksha P. [email protected] wrote:
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
hi,
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??
i haven’t used corn before so can you please tell me something in
detail??
On Sun, Sep 20, 2009 at 8:56 PM, Preksha P. [email protected] wrote:
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.
On Sun, Sep 20, 2009 at 8:56 PM, Preksha P. [email protected] wrote:
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.
Did not get what you meant by this question. Anyway
cron is a unix, solaris utility that allows tasks to be automatically
run in the background at regular intervals by the cron daemon
And
Crontab (CRON Table) is a file which contains the schedule of cron
entries to be run and at specified times.
After creating your rake tasks you can call it fron cron For that from
console type
crontab -e
This will open the crontab file in edit mode There put your entries
ne example from above link is
Did not get what you meant by this question. Anyway
cron is a unix, solaris utility that allows tasks to be automatically
run in the background at regular intervals by the cron daemon
And
Crontab (CRON Table) is a file which contains the schedule of cron
entries to be run and at specified times.
After creating your rake tasks you can call it fron cron For that from
console type
crontab -e
This will open the crontab file in edit mode There put your entries
ne example from above link is
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 not get what you meant by this question. Anyway
cron is a unix, solaris utility that allows tasks to be automatically
run in the background at regular intervals by the cron daemon
And
Crontab (CRON Table) is a file which contains the schedule of cron
entries to be run and at specified times.
After creating your rake tasks you can call it fron cron For that from
console type
crontab -e
This will open the crontab file in edit mode There put your entries
ne example from above link is
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.