RomanW
RomanW

Reputation: 13

repeat a wget (or curl) download infinitely

I'm stuck with the following problem:

I want wget (or curl, whatever may be suitable) to repeatedly check a folder for new files, and if there are, download them.

The thing is that: at some point wget always thinks, it's "done". i already tried

-r -nc -nd 

and also

-t 0 

options; but I can't get it to work.

Background

I have a GoPro (which can be accessed via Wi-Fi). I want to use as webcam in such a way as it repeatedly takes photos. I can get wget to download the files from the GoPro, but i need this progress to be repeated as long as the GoPro takes photos.

As next step i want curl to always take the latest photo, rename it to, say, default.jpg and upload it to an ftp server, where it is always overwritten. But i would be happy with that wget problem already ;)

Upvotes: 1

Views: 5599

Answers (2)

RomanW
RomanW

Reputation: 13

thanks, I managed it via repeat & delay from applescript, which does not appear to be very elegant, but works, now for the upload part!

Upvotes: 0

nitowa
nitowa

Reputation: 1107

You might want to take a look at the watch command. http://www.linfo.org/watch.html

Syntax: watch [option(s)] command

By simply calling watch [your wget here], your command will automatically be run every two seconds until you CTRL+C out of it.

Upvotes: 4

Related Questions