Monday, March 30, 2009

Wget running in background and even if terminal closed (Cheers to Nohup ;)

nohup wget -cb -o /tmp/download.log -i /tmp/download.txt

'-c' - Continue getting a partially-downloaded file
'-b' - Going to background
'-i file' - Read Urls from file. If ‘-’ is specified as file, urls are read from the standard input.
'-o logfile' - Log all messages to logfile. The messages are normally reported to standard error.

If used without '-b' switch use "&" at the end of (nohup) wget command.(I.E. nohup wget -c -o /tmp/download.log -i /tmp/download.txt &)

nohup Command [Arg] - No Hang Up. Run a command
immune to hangups,runs the given command with
hangup signals ignored, so that the command can
continue running in the background after you
log out.

No comments:

Post a Comment