Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8015419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:15:19+00:00 2026-06-04T20:15:19+00:00

I have a Ruby script that crawls a site, and takes 40 minutes. What

  • 0

I have a Ruby script that crawls a site, and takes 40 minutes. What I would like to do is dump the results into a database and be able to do regular ActiveRecord stuff on the data.

  1. If I put it in a Rails app and have a ‘start’ button that initiates the script, will it time out?
  2. Ideally I want the script to run at least once a day – and update the db – so would my best bet be to create a rake task, or is there some other way to do this?
  3. If I am wrapping this in a Rails App, in which folder should I put the script and what is the best way to approach it? I can’t drop it in a model file – because that doesn’t make any sense.
  4. I have never done any ‘Job’ type processing before, but this sounds like it may fall in that purview. What other things should I consider when doing this?

Edit 1:

Another question is, if I put this particular Ruby script in my /lib directory, how do I get it to interact with the DB? I usually interact with the DB from the model and controller. How would I store the results in my DB after it is run?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:15:20+00:00Added an answer on June 4, 2026 at 8:15 pm

    I’ll try to give you some straightforward answers.

    A) You would most likely put it as a background job. There are some decent gems for that. Consider https://github.com/defunkt/resque or something more lightweight such as https://github.com/tobi/delayed_job.

    B) A rake task would suffice and then run it with either of the mentioned libraries. Another option would be a cron job.

    C) You should put it in the lib/ directory.

    D) You should always have some kind of processing log available in order to track potential errors. Be sure to read the instructions properly if you choose any of the two libraries mentioned above.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Ruby script that defines a class. I would like the script
I have a simple Ruby script that looks like this require 'csv' while line
I have rails website that shows information from database. And I have ruby script
I have a Ruby script that looks like: def big_function puts starting... #does stuff
I have been working on a Ruby Script that enters in data into a
I have a ruby script that executes another ruby script via backticks. Like this:
I have a Rails script that I would like to run daily. I know
so i have ruby script that simply writes to a test.txt file with hello
I have a ruby script that does a few perforce operations (through the scripting
I have a ruby script that is simultaneously and asynchronously receiving and displaying messages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.