[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Timeouts need 'page' and 'byte' options
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] Timeouts need 'page' and 'byte' options |
Date: |
Tue, 30 Sep 2014 10:00:34 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Darshit Shah <address@hidden> writes:
>>Can you add a --page-timeout which will
>>exit wget after n secs loading a single page?
>>
> Honestly, I'm unable to see any major use-case for such a
> functionality. Why would you want to download a page for only a
> constant number of seconds?
>
> Anyhow, if you do have a valid use case for this, I'd suggest
> scripting a solution around Wget. You could invoke Wget in background
> mode with -b, sleep() for the amount of time you want and then send a
> SIGKILL signal to the Wget process. Killing Wget with SIGKILL will
> result in an exit status of 130, which you can use to check if Wget
> was indeed downloading a file at the end of the timeout or it had
> completed its job and exited, in which case the kill command will exit
> with a status of 1.
another option would be to use the "timeout" program from coreutils, it
should be available by default on any GNU/Linux distro:
$ timeout DURATION wget ......
you can also specify the signal to send to the process.
Regards,
Giuseppe