How to monitor WGET download progress after closing SSH session

If you run wget and close the terminal or terminate your ssh session , it will terminate the wget process too. You need to run wget and keep it running even after the session is closed.

For that purpose there are many tools.

   wget -bqc http://path-to-url/linux.iso

You will see a PID on screen:

Continuing in background, pid 12345.

Where,

-b : Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget-log.
-q : Turn off Wget’s output aka save disk space.
-c : Resume broken download i.e. continue getting a partially-downloaded file. This is useful when you want to finish up a download started by a previous instance of Wget, or by another program.

The nohup command

You can also use the nohup command to execute commands after you exit from a shell prompt. The syntax is:

   $ nohup wget -qc http://path-to-url/linux.iso &

   ## exit from shell or close the terminal ##
   $ exit

The disown bash command

Another option is to use the disown command as follows:

      $ wget -qc http://path-to-url/linux.iso &
      [1] 10685
      $ disown wget
     $ ps
        PID TTY          TIME CMD
        10685 pts/0    00:00:00 wget
        10687 pts/0    00:00:00 bash
        10708 pts/0    00:00:00 ps
     $ logout

The screen command

You can also use the screen command for this purpose.


Go to download directory and type

tail -f wget-log 

Tags:

Ssh

Wget