No quite like that. If you're sending an HTTP GET request to any URL, you
would pass parameters to the URL itself, something like:
http://localhost:3000/cron?param1=value1&param2=value2 etc

What looks attractive to me about this approach (of using wget via cron
instead of a rake task) is that you are not bringing up an entire rails
environment to handle a task. There's less overhead. Just be sure to lock it
down with a combination of things that have been suggested here: IP Address
check, local_request?, http basic authentication. There may be more you can
do...

On Sat, Feb 14, 2009 at 12:52 AM, Valentino Lun <
rails-mailing-l...@andreas-s.net> wrote:

>
> >>  wget http://localhost:3000/cron
> >>
> >> cron_controller invokes your method
> >
> > Thanks, it is a very good idea. How about if my action require 2
> > parameters? How to do that?
>
> Let me further elabroate on my question. For example in my Cron
> Controller
>
> def someaction
>   some_method(params[:one],params[:two])
> end
>
> Is it possible to do this in my crontab as follow?
>
> 10 10 * * * wget http://localhost:3000/cron/someaction "para1" "para2"
>
> Many thanks
>
> Valentino
> --
> Posted via http://www.ruby-forum.com/.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to