Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bash trigger wget command and don't wait for response, continue to the next command

Tags:

linux

bash

wget

Is there a way I can trigger a wget command via bash script and continue to the next command in the bash script without waiting for a response from the wget? i am executing a command which should take lots of time and don't want wget to hold for a response nor re-trigger it after timeout has been timeout limit

like image 854
Broshi Avatar asked Oct 16 '25 04:10

Broshi


1 Answers

You should use the --background option, as it goes to background and saves the output to a log

--background
       Go to background immediately after startup.  If no output file is specified via the -o, output is redirected to wget-log

Example:

$ wget http://cdimage.ubuntu.com/ubuntu-server/daily/current/wily-server-ppc64el.iso --background
Continuing in background, pid 79783.
Output will be written to ‘wget-log’.

$ cat wget-log 
--2015-05-12 11:21:35--  http://cdimage.ubuntu.com/ubuntu-server/daily/current/wily-server-ppc64el.iso
Resolving cdimage.ubuntu.com (cdimage.ubuntu.com)... 91.189.92.164, 2001:67c:1360:8c01::1f
Connecting to cdimage.ubuntu.com (cdimage.ubuntu.com)|91.189.92.164|:80... connected.
....
like image 67
Breno Leitão Avatar answered Oct 17 '25 18:10

Breno Leitão



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!