I would like to be able to do this: I want to generate a pdf all Fridays at an specific time. This pdf should be stored in an specific place too. So I think something that makes the application able to look at what time is it and do this pdf when this time arrives, even if no one is using the application. I already know how to make the pdf and how to store it, but I need help with generating this pdf at an specific time, without any user pressing a button. -- 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 -~----------~----~----~----~------~----~------~--~---
On 20 Mar 2008, at 23:17, John Smith wrote:> I would like to be able to do this: I want to generate a pdf all > Fridays > at an specific time. This pdf should be stored in an specific place > too. > So I think something that makes the application able to look at what > time is it and do this pdf when this time arrives, even if no one is > using the application. I already know how to make the pdf and how to > store it, but I need help with generating this pdf at an specific > time, > without any user pressing a button.A few options: - Cron tab and script/runner - BackgroundRB and its scheduler - Ruby thread with sleep The subject has come up recently in a slightly different context so if you google around on the keywords mentioned above, you should find everything you need. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
ESPNDev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Mar-20 22:49 UTC
Re: Help with schedule and pdf
Have you checked out this Rails tutorial: http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails Line 4 says: "Alternately can I write a background job that''ll, for example, spit out a nicely formatted text file every night at 2:00 AM?" Seems like what you''re talking about :) There''s a bunch of resources out there for learning to write CRON jobs. Check ''em out. ESPNDev On Mar 20, 3:17 pm, John Smith <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I would like to be able to do this: I want to generate a pdf all Fridays > at an specific time. This pdf should be stored in an specific place too. > So I think something that makes the application able to look at what > time is it and do this pdf when this time arrives, even if no one is > using the application. I already know how to make the pdf and how to > store it, but I need help with generating this pdf at an specific time, > without any user pressing a button. > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
>> I would like to be able to do this: I want to generate a pdf all Fridays >> at an specific time. This pdf should be stored in an specific place too. >> So I think something that makes the application able to look at what >> time is it and do this pdf when this time arrives, even if no one is >> using the application. I already know how to make the pdf and how to >> store it, but I need help with generating this pdf at an specific time, >> without any user pressing a button. > > A few options: > - Cron tab and script/runner > - BackgroundRB and its scheduler > - Ruby thread with sleepThese are of course the preferred options (in the order they have been posted by Peter) but if none of this will work in your hosting environment you might have to simply wait for the next hit on your application and then if current_time > time_at_which_pdf_should_be_generated you run a background job to generate it. I remember that a few years ago there were also plenty of serivces on the mighty interweb which called a specified URL at a given time (sort of a remote cron job if you will). This might be best if the above three won''t work. Cheers, Niels. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---