Hi, I''m coding a scheduling application where reminders are sent out to users at date-times specified by the users. What''s the best way to do this? Thanks! :) Bob --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> I''m coding a scheduling application where reminders are sent out to > users at date-times specified by the users. What''s the best way to do > this?On a *nix server, you''ll want to use cron. On a Windows server, you might be able to use Scheduled Tasks. An often-adopted approach is to create a "maintenance/scheduling" controller whose actions are invoked by wget through cron. The following example crontab line will hit your controller hourly: 0 * * * * wget -O - -q http://www.domain.tld/maintenance Roderick -- Nedforce Informatica Specialisten B.V. http://www.nedforce.nl +31 (0)53 4500225 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg wrote:>> I''m coding a scheduling application where reminders are sent out to >> users at date-times specified by the users. What''s the best way to do >> this? > > On a *nix server, you''ll want to use cron. On a Windows server, you > might be able to use Scheduled Tasks.There used to be a rails_cron plugin as a cross-platform, Rubyish solution for this need. Sadly, it was abandoned: http://kylemaxwell.typepad.com/everystudent/2006/09/railscron_depre.html You may want to check out BackgroundRb: http://backgroundrb.rubyforge.org/ -Adam -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg wrote:>> I''m coding a scheduling application where reminders are sent out to >> users at date-times specified by the users. What''s the best way to do >> this? > > On a *nix server, you''ll want to use cron. On a Windows server, you > might be able to use Scheduled Tasks.As suggested above, you can use Unix cron / Windows scheduled tasks to run a Rails rake task. http://www.fallenrogue.com/articles/168-Script-vs-Rake Create a new file in lib/tasks with the extension .rake with your required task. To invoke it simply cd to your rails directory and run rake with your task name (optionally specify the Rails environment). The code inside the task will have full access to your Rails environment including models. cd /path/to/rails/application rake <task_name> RAIL_ENV=production Ben --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
> >> I''m coding a scheduling application where reminders are sent out to > >> users at date-times specified by the users. What''s the best way todo> >> this? > > > > On a *nix server, you''ll want to use cron. On a Windows server, you > > might be able to use Scheduled Tasks. > > As suggested above, you can use Unix cron / Windows scheduled tasks to > run a Rails rake task.That *is* a better option. And another PHP-ism flies out the window... Roderick -- Nedforce Informatica Specialisten B.V. http://www.nedforce.nl +31 (0)53 4500225 --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ben wrote:> cd /path/to/rails/application > rake <task_name> RAIL_ENV=productionOops, I made a small typo, that should be RAILS_ENV=production --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Roderick van Domburg wrote:> On a *nix server, you''ll want to use cron. On a Windows server, you > might be able to use Scheduled Tasks. > > An often-adopted approach is to create a "maintenance/scheduling" > controller whose actions are invoked by wget through cron. The following > example crontab line will hit your controller hourly: > > 0 * * * * wget -O - -q http://www.domain.tld/maintenance > > Roderick >On Windows, I use PyCron for this and it''s not bad. Just search Google for it. Cheers Mohit. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---