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 8241621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:53:34+00:00 2026-06-07T20:53:34+00:00

In my project I need to upload a big file (~250GB) to remote server,

  • 0

In my project I need to upload a big file (~250GB) to remote server, and then run a script to load the file into mysql.
The problem is, if I load the single file it will take too long time. So I have to split the file into small trunks and run 10-20 processes simultaneously in multiple terminals. If I split each file ~2MB, it will take me 100,000 times operation.Then I have to run like

ruby importer.rb data_part01_aa.csv
ruby importer.rb data_part01_ab.csv
ruby importer.rb data_part01_ac.csv
.
.
.

in each terminal, wait for them to end, and run the next.

Is there any method that can automate this process? Any shell scripts that can continue doing the job when the previous one is finished?
Thanks a lot!

  • 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-07T20:53:36+00:00Added an answer on June 7, 2026 at 8:53 pm

    In shell you can try:

    for i in *.csv
    do
        ruby importer.rb $i.csv
    done
    

    The previous one can be written as one-line as follow:

    for i in *.csv; do ruby importer.rb data_part01_aa.csv; done
    

    Eventually, it can take some time to start running if the arguments are too many. In such case, you can try with find:

    find . -name '*.csv' -exec ruby importer.rb {} \;
    

    However, the previous command will search recursively in every sub-directory. To make it run for the current directory only, you will have to run:

    find . -maxdepth 1 -name '*.csv' -exec ruby importer.rb {} \;
    

    In every example given, the commands will be run sequentially. Instead of *.csv you can play with different patterns (i.e. a*.csv, b*.csv, [ab]*.*csv, etc.), or you can try another loop:

    for j in $(echo {a..q})
    do
        find . -name "data_part01_$j?.csv" -exec ruby importer.rb {} \; &
    done
    

    Where echo {a..q} generates a sequence of letter from a to q, which seems to follow the names of your files. The key in the last example is the &, which leaves the process in background, in the last example, there will 17 process running simultaneously. If you do not want them simultaneously, then you just need to remove the ampersand &.

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

Sidebar

Related Questions

I need to upload a single image to server. The project is using .NET
I need to upload a single image to server. The project is using .NET
when i upload file in mvc3 project i need validation for sicze limit and
I need to implement in my project ASP .NET MVC3 the jQuery file upload
I'm writing a php file upload script for a project - I have seen
I have a zendframework project for which i need to run a script periodically
I have a project that I need to upload to my svn server. There
I try to implement file uploader script from this Github project and I need
The Junits I have in my project need to load property files from the
I am working on a project, in which I need to upload the .swf

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.