Home > Linux >
Wget - Download manager | Sitemap Search |
|
Sections Membership Features
Recent comments
very difficult by alfin Taking the credit for another persons work ? by curious dude. |
Wget - Download managerPosted by martin on 1 May 2002. Wget shell scripts for easier usage and how to make filenames DOS/Windows compatible. If you don't have a copy of wget you get one from a GNU mirror close to you or if you can't find one from GNU directly. Download monitorThis is a simple script to check on the progress wget has made while downloading something,
you have to specify #!/bin/bash j=0 while true do clear echo "=== Iteration $j ===" for i in `ls ~/downloads/wget-log*` do /usr/bin/head -1 $i printf "\n" /usr/bin/tail -3 $i printf "\n\n" done let j++ sleep 5 done Download files from a listAnd the following reads a list of URIs (along with parameters to wget if any)
and starts a maximum of #!/bin/bash cd $HOME/downloads/ PATH=/bin:/usr/bin line=1 max_proc=3 list_file="$HOME/downloads/todo.txt" prog="/usr/local/bin/wget" while true do while true do proc=`ps -f -u $USER | grep -c $prog` # grep is in the list too let proc-- lines=`grep -c "" $list_file` echo "Proc: $proc / $max_proc Line: $line / $lines" [[ $proc -ge $max_proc || $line -gt $lines ]] && break params=`grep -n "" $list_file | grep "^$line:" | sed -e "s/^$line://"` echo $params | tee -a done.txt archive.txt # ignore empty lines if [ "$params" ]; then $prog -b $params sleep 3 fi let line++ done echo "Waiting..." sleep 10 done DOS/Windows compatible filenamesIf you download sites when running Linux/Unix and then try to copy the files
to your DOS/Windows partition you may have experienced problems with This requires wget version 1.8.2 (probably some changes may be made to future
versions, please don't rely on this information only if you are using a different version
of wget), you will have to edit
#if WINDOWS || __CYGWIN__
/* Use '_' instead of ':' here for Windows. */
dirpref[len] = '_';
#else
dirpref[len] = ':';
#endif
...
#if WINDOWS || __CYGWIN__
/* Temporary fix. Use '@' instead of '?' here for Windows. */
*to++ = '@';
#else
*to++ = '?';
#endif
...
/* DOS-ish file systems don't like `%' signs in them; we change it
to `@'. */
#ifdef WINDOWS
{
char *p = file;
for (p = file; *p; p++)
if (*p == '%')
*p = '@';
}
#endif /* WINDOWS */
You need to change The second fragment is found twice in the source, the third one is optional
as neither I nor Herold could prove that FAT/NTFS doesn't allow Commentsmonitoring wget log file ... by Rahul Sawarkar (torahuls@vsnl.com) on 5 Mar 2003 4:41pm GMT FYI: I use "watch tail -n36 <wgetlogfile> to constantly monitor download progress. Setting --dotstyle might help for large files. Regards monitoring wget log file by Foltos () on 11 Mar 2003 10:21am GMT I use tail -f <wgetlogfile> to constantly monitor wget progress. Simple and good :) BR. Great list script! by Zach Borgerding () on 5 Jul 2003 2:09pm GMT I love this script for downloading files from a list! I was going to write one, but found yours, and it works great! ;) Thanks! hello by Sumit (sumitsureka@rediff.com) on 17 Aug 2003 8:11pm GMT thank u Wget by Michael (mantra@spraci.zzn.com) on 21 Aug 2003 6:34am GMT What is the Proc command for in WGET, for example if a url has 20 sub-urls or links in its htm page are all these links retrieved as well ? for example wget proc-3 http:/linux.org would it retrieve linux.org proc-1 linux.org/linuxdocs proc-2 linux.org/programs proc-2 linux.org/linuxdocs/bins proc-3 nice script by zig () on 11 Oct 2003 10:02am GMT but what if the user name of the password directory is an email address, how do I go around that? Knowledge and Society by indigen (indigen@vsnl.net) on 17 Mar 2004 7:19pm GMT wget c <filename> does not continue the download, but starts a fresh download . Why ? looking for a wget gui by xispas (xispas@mail.pt) on 12 Apr 2004 9:28am GMT indigen, you miss the dash "wget -c" and the resume function is dependent of the server down load manager by richards (rrichards@madhuri.com) on 15 May 2004 8:19am GMT regarding down load manager gui? by () on 26 May 2004 6:49pm GMT review guis for wget? This is a nice comand by Karthikeyan () on 2 Nov 2004 11:06am GMT This is a nice comand |