14 May
2017
14 May
'17
20:40
On Sun, 2017-05-14 at 16:27 -0400, Patrick Shanahan wrote:
* Istvan Gabor
[05-14-17 15:32]: Hello:
I would like to use cron to start and stop wget commands using wget -q (quiet) and -b (background) options. For stopping the correct wget connect at given time I need to know its pid. wget -bq url runs like this:
wget -b -q -O output-file url-address Continuing in background, pid 10874.
I should somehow record the pid in a file and use it with the kill command, but I don't know how I could do it.
simple if you have only one instance of wget or want to kill all instances: kill -9 `pidof wget`
I did not know of "pidof" command. Useful to know. Regards. Sudhir