cURL / Mailing Lists / curl-users / Single Mail


Re: Download multiple files from ftp

From: Lubomir Brindza <>
Date: Fri, 04 Oct 2013 08:57:06 +0200

> The problem is that the file on ftp site changes name everyday.
> For example, the file name is ce2013-10-03-10.14.02.sql.gz and everyday the final part of the file changes.
> Since curl does not accept wildcards, how can I download my file without editing my batch file everyday?
> In addition, I need to save that file in a specific directory, but my guess is that I can simply use:
> -o "F:\Backup\website-db\

Hi. You can use number sequences in cURL URLs, like this (shamelessly
stolen from the manpage):[1-100].txt[001-100].txt (with leading zeros)[a-z].txt

...and while specifying the output filename, use "#1" to substitute the
actual value cURL found the file at, so in your example:

ftp://.../ce2013-10-03-[00-23].[00-59].[00-59].sql.gz -o

Of course, this will produce quite the number of possible combinations,
so the more you can narrow the range down, the better.
List admin:
Received on 2013-10-04