14
1
If I write wget "no such address" -o "test.html" it first creates the test.html and in case of failure, leaves it empty. However, when not using -o, it will wait to see if the download succeeds and only after that, it'll write the file.
I'd like the latter behavior to be applied to -o too, is it possible?
Also, adding --retry-connrefused can help in preventing the empty file in the first place. – akom – 2017-12-29T15:40:01.213
If this is happening in an exec in a puppet manifest, changing creates => file to unless => "[ -s file ]" can make it self-healing. – akom – 2017-12-29T15:41:42.323