So I have this Bash subroutine to download files using wget and my problem now is how to skip successfully downloaded files. The script downloads a lot of files and once the download fails, it re-downloads all files overwriting those successful downloads from the start (which may be incomplete because of the re-download).
So how do I skip those files downloaded successfully?
DownloadFile() { paramURL=$1 paramFilename=$2 if [ $flag_archive_fetch = "false" ]; then wget "--timeout=180" "--tries=5" "$paramURL" "-O" "${scratch_dir}$paramFilename" else unzip -o "$archive_file" "$paramFilename" -d "${scratch_dir}" fi touch "${scratch_dir}$paramFilename" }