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

  • Home
  • SEARCH
  • 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 8940317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:00:23+00:00 2026-06-15T11:00:23+00:00

I have about 5 or 6 ruby scripts I want to run, right after

  • 0

I have about 5 or 6 ruby scripts I want to run, right after each other. These are all on my local machine (OS X) and won’t be run on a server.

Each takes about 15 minutes to run, and I don’t want to have to wait for each one to finish before running the others manually.

Without using something as heavy as delayed_job or some other queueing gem, how can I achieve this?

Or should I go through the hassle of setting up sidekiq or something else?

Thanks.

P.S. It would be nice to restart the script if one of them times out (I am doing web crawling, so keeping an HTTP connection open sometimes gives me issues) – which happens occasionally.

  • 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-15T11:00:23+00:00Added an answer on June 15, 2026 at 11:00 am

    As Zabba said, writing a script to call your scripts is a good solution. You could write a simple Bash script for this, or use Ruby as shown below:

    #!/usr/bin/ruby
    
    SCRIPTS=%w{s1.rb s2.rb s3.rb}
    MAX_RETRIES=3
    
    SCRIPTS.each do |script|
      MAX_RETRIES.times do |n|
        system "ruby #{script}"
        break if $?.exitstatus == 0
      end
    end
    

    This uses the system call in Ruby, and $? is the Process::Status object that you can use to capture the exit codes of your scripts.

    For this to work properly, you just need to make sure that your scripts return an exit code (using the exit command) of 0 when successful, or something non-zero, e.g. 1 on failure.

    There are some obvious security concerns running system, so unless you’re on your local machine set your permissions accordingly 🙂

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

Sidebar

Related Questions

I have a question about ruby on rails and the process of assigning variables
Hi I have a question about ruby on rails Apparently I have a statement
this time it's about Ruby On Rails. I have a form in the view
I’m relatively new to Ruby, Sinatra, and DataMapper, but have a question about DataMapper
I am programming in Ruby and have wanted to learn about matrices but I
I'm a Ruby newbie. Have a very basic question about static and instance variables.
Good afternoon, I'm learning about using RegEx's in Ruby, and have hit a point
I have about 20 grid views that I have to create. All of them
i have about 60 fragments ListFragment , now i use each Listfragment with another
I want to create a query that will return all Alerts that have a

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.