diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-08-11 18:07:18 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2010-08-11 18:07:18 (GMT) |
commit | e8f9aeade3493ff625755f850473e3bb6d218575 (patch) | |
tree | 76b5fa913b1ea6725f8a0b87cd95d8ccfbb0144a /scripts/functions | |
parent | 63235bd89ce336aa21f8442b8f7d3bcde2ca7d25 (diff) |
scripts: in case of failed download, remove partial files
It happens from time to time that the server mis-behaves, and breaks the
connection right in the middle of nowhere, for no good reason, leaving us
with a partial file, on which the extract pass would choke.
Remove partial downloads, to fail early.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions index b69efd1..09ccf15 100644 --- a/scripts/functions +++ b/scripts/functions @@ -363,7 +363,7 @@ CT_DoGetFileWget() { # connecting, so force a global ${CT_CONNECT_TIMEOUT}-second timeout. CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 --passive-ftp "$1" \ || CT_DoExecLog ALL wget -T ${CT_CONNECT_TIMEOUT} -nc --progress=dot:binary --tries=3 "$1" \ - || true + || rm -f "${1##*/}" } # Download an URL using curl @@ -374,7 +374,7 @@ CT_DoGetFileCurl() { # so, be silent. CT_DoExecLog ALL curl -s --ftp-pasv -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f \ || CT_DoExecLog ALL curl -s -O --retry 3 "$1" --connect-timeout ${CT_CONNECT_TIMEOUT} -L -f \ - || true + || rm -f "${1##*/}" } # Download using aria2 |