curl / Mailing Lists / curl-users / Single Mail


Re: Download Only If Newer

From: Ray Satiro <>
Date: Tue, 11 Sep 2018 15:35:13 -0400

On 9/11/2018 2:32 PM, Gerard Seibert wrote:
> I am using curl 7.61.1 on an amd64 FreeBSD 11.2 machine.
> I am trying to download a file from SpamHaus, but only if it is newer. This is the command line syntax I am using:
> curl --s -L -R -z drop.txt -o drop.tmp
> Failed to set filetime 1536603588 on outfile: No such file or directory
> As you can see, if the file is not newer, it produces an error message. I am trying to find a way to suppress that error message, but without any success. I have tried adding "2>&1" to the end of the command, but it doesn't help.

curl's --silent is documented as "Don't show progress meter or error
messages." [1] but does not go as far as changing the error stream which
is what you are seeing [2]. That could be clarified or fixed. The reason
2>&1 doesn't work is because you are redirecting stderr to stdout which
is unchanged. You could 2>/dev/null or 1>/dev/null 2>&1 or to a lesser
extent --stderr /dev/null, but that last one won't stop a library
libcurl uses from outputting to stderr (which should not happen but you
never know). curl is trying to set the filetime [4] on a file that
(presumably) doesn't exist which seems like a bug.


Received on 2018-09-11