LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices

Reply
 
LinkBack Search this Thread
Old 08-04-2006, 09:50 PM   #1
RodWC
Member
 
Registered: Oct 2005
Distribution: Debian Etch i386, Lenny and Sid amd64
Posts: 176

Rep: Reputation: 30
Stop a download after specified file size


Hi all, I have satellite Internet service, which is still subject to the silly "Fair Access Policy." I have a roughly 350MB "bucket" which refills at a steady rate which is a little faster than good dial-up. So, I can download around 370MB all at once, then it slows down. I don't like to FAP myself, so I was just wondering if there is a program in Linux (Debian, specifically) to stop a download (700M ISO, for example) after a certain amount (~350M).


Thanks!
 
Old 08-07-2006, 11:43 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
I think what you want can be done with wget.

Code:
$ wget --help | grep continue
  -c,  --continue  ... resume getting a partially-downloaded file
$ wget -q http://www.site.example/file.iso &
$ while [ $(ls -l file.iso | awk '{print $5}' -lt 350000000 ]; do true; done
$ kill -INT $!
$ sleep 3600 # until you have more bandwidth
$ wget -c -q http://www.site.example/file.iso &
You might want to put this inside a shell script, perhaps in a loop, and replace 350000000 with 350MB *plus* the file size before downloading. `$!' is the process ID of the process last put into the background. The rest have manual pages (see also man bash).

I'll happily explain if you need me to. If so, please tell me the exact sequence of commands you have already tried, your reasoning behind it, and what you don't understand. script(1) might come in handy for this.
 
Old 08-18-2006, 08:33 PM   #3
RodWC
Member
 
Registered: Oct 2005
Distribution: Debian Etch i386, Lenny and Sid amd64
Posts: 176

Original Poster
Rep: Reputation: 30
Thanks very much I will give this a try. I don't have the time at this point but will definitely try that out and get back to you here sometime.
 
Old 08-19-2006, 06:45 AM   #4
Ehwaz
Member
 
Registered: Aug 2006
Distribution: FC, Mandriva, Suse
Posts: 52

Rep: Reputation: 15
Maybe a bit obvious, but still...
Do you have enough disk space left? I downloaded an ISO once and it always stopped at 500MB, wouldn't budge any longer. When I suddenly looked at the free disk space, I noticed I only had 500MB left...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i wont download the file size above 2MB kannanulinux Linux - General 4 03-08-2006 09:10 AM
Fast Download Site for Linux, enables >4GB Download of single file TigerLinux Linux - Distributions 9 10-29-2005 12:45 PM
How to stop download vivekthemind Linux - Networking 0 10-20-2005 07:04 AM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 04:18 PM
Konqueror wont download download TAR,ZIP file but preview Velocide Linux - Newbie 0 03-22-2004 06:07 AM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration