开发者

Check if file exists on FTPS site using cURL

I am using the cURL app to download multiple csv files. I want to find a way to check if the file开发者_如何学编程 exists on the ftps site before kicking off the download. If it doesn't exist I would like to find a way for cURL to check again at regular intervals. I am trying to stick to using cURL commands for this I am really not good at .Net programming. Any help would be appreciated


$ curl ftp://[host]/[path] --ssl --head

(you might also need -k)

--ssl: Try to use SSL/TLS for the connection

--head: When used on an FTP or FILE file, curl displays the file size and last modification time only

It will return an error if the file doesn't exist. It will not keep checking, it will only check once so you need to do the repeated checking using some scheduler/cron/script or whatever.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜