[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] execute external command only if download occurs with tim
From: |
Micah Cowan |
Subject: |
Re: [Bug-wget] execute external command only if download occurs with time stamping |
Date: |
Wed, 20 Oct 2010 18:42:38 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.9) Gecko/20100922 Thunderbird/3.1.4 |
On 10/20/2010 04:34 AM, Kamenik, Aleksander wrote:
> Hi,
>
> I periodically download a file with "wget -N someurl". I want to execute some
> external program to process the downloaded file, but only when wget actually
> downloaded a new version of it.
>
> I'm using time stamping and wget always exits with zero if it could contact
> the server. So I can't use "wget -N someurl && somescript.sh", this would
> always execute the program.
>
> Currently I use the -nv switch and then count lines of stderr+stdout and if
> it's 1, then execute the script.
>
> Is there a better way, something like find's --exec?
>
> Wget version 1.11.4 on linux
If you obtain the more recent release, 1.12, better handling of exit
codes should allow you to use the && somescript.sh syntax, I think.
Hope that helps,
-mjc