2
How can I set up something on a Linux machine so that the moment a file on a web server returns something other than a 404 error it will download it. I would like it to stop checking the moment the file is started to download successfully, but still retry if it fails.
I have tried using a cron job with wget, but I can't seem to figure out how to make it not create an empty file on a 404 error.
Is this possible and how?
I have almost solved it using a variation of your answer:
wget -q -O /tmp/a http://localhost/nonexistent && (mv /tmp/a /tmp/b; echo Success)
– geek1011 – 2016-04-23T15:35:20.613