LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


View Poll Results: Windows will be no more within upcomming 10 years..
Ofcourse ! I firmly belive this 7 13.46%
Perhaps... 25 48.08%
It can gain mre attention but Linux could never overtake Windows!! 11 21.15%
NO, Its totally impossible !! 9 17.31%
Voters: 52. You may not vote on this poll

Reply
  Search this Thread
Old 04-09-2010, 05:28 AM   #1
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Rep: Reputation: 18
Lightbulb How to make multiple threads of currently running shell script?


I am developing a project of simple download scheduler in Linux using the LYNX command line browser.
Basically this application will work in 4 steps AUTOMATICALLY (i.e. @ pre-specified time):
1) to connect to the internet
2) Go to download page, and login using the LYNX command line web browser.
3) Start download.
4) disconnect from web, save any uncomplete downloads , halt the computer.

All works smoothly. But what if I could make multiple threads of the script running "wget" command ??

Obviously my speed of downloading is going to be increased.

I am ready if I need to create individual script for all wget commands.

If this is not possible please give me suggestions that how can I create multiple instances of downloading process.
 
Old 04-09-2010, 05:40 AM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Your problem is not threading (it would be, but you are not even at that stage yet). Your problem here is that wget and lynx have no support, as far as I know, to do what you want. Both will take an URL and fetch it, but there's no way to tell wget to download only a portion of a given file (again, as far as I know), the same goes for lynx.

Why not just use something like axel?
 
Old 04-10-2010, 02:39 AM   #3
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
Yeah , but what is axel ? I don't knw about it at all..can yu give me a link 4 tht or some explaination please ?
 
Old 04-10-2010, 03:21 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Are you incapable of using web search ?.
I too read that post yesterday, and it took 2 minutes to find all sorts of info about axel - and other possible options.
 
Old 04-10-2010, 03:30 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
http://lmgtfy.com/?q=axel

The third link that comes up is your answer. If you want to increase the download speed for your download by splitting the files into different segments and downloading them simultaneously, you would need download accelerator of some kind. A browser will not do that.
 
1 members found this post helpful.
Old 04-17-2010, 05:12 AM   #6
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
Lightbulb Can curl do what I want ?

Dear all friends,
Can curl help me in which i'm interestred ??
 
Old 04-17-2010, 05:27 AM   #7
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
Post

@i92guboj,

First of all thanks for your suggestion.
axel is really good !!
Yeah i knw smthng by nt everything, so improper knowledge would pinch me.but as this download scheduler is my semester project . so i HAVE TO show some kind of coding in it.

Ri8 now i 've 2 ideas in my mind ...
1) sync command
AND ...
2) curl command.
Now can multithreading help me ??
 
Old 04-21-2010, 07:28 PM   #8
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
@ i92guboj :

by using the system("<command>"); i am able to call sys cmds from C.
now I want to make multipl threads of downloading so cURL or wget which is your suggestion ? another command is also welcomed..
 
Old 04-21-2010, 07:32 PM   #9
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
any one can help me...
 
Old 04-21-2010, 07:44 PM   #10
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Can you please spell your words out correctly? I find your posting
style rather irritating.
 
Old 04-21-2010, 07:51 PM   #11
aarsh
Member
 
Registered: Mar 2010
Location: USA
Distribution: Ubuntu MATE
Posts: 182

Original Poster
Rep: Reputation: 18
@ Tinkster : for sure .
----------------------------

Please tell me the perfect pair from these >

to schedule : at, crontab .. ???
&
to download any particular file from given URL : wget, cURL ...

anyone, please...
 
  


Reply

Tags
multiple



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Preventing multiple instances of a shell script from running concurrently Dave Lerner Programming 17 04-21-2020 12:53 PM
Runs Multiple shell script inside a main script using crontab srimal Linux - Newbie 4 10-22-2009 06:19 PM
Shell script for multiple OS investmentbnker75 Programming 2 06-28-2009 04:37 PM
running a shell script which invokes another shell program!!! raghu123 Programming 1 08-04-2008 09:10 AM
Need to make multiple lines into one with no extra spacing with shell script. sunksullen Programming 10 05-10-2007 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration