Skip to content

Instantly share code, notes, and snippets.

@didasy
Created February 24, 2015 15:33
Show Gist options
  • Save didasy/621504bfa94bf62304c7 to your computer and use it in GitHub Desktop.
Save didasy/621504bfa94bf62304c7 to your computer and use it in GitHub Desktop.
# This use wget to download the file with:
# infinite retries
# keep retrying even when there is no connection
# wait 3s between retries
# continue from last point if failed and there is a file named test.file in the target directory
# with limited bandwidth rate of 2 000 000 Bytes/s
# and put the file to the path/filename
wget -t 0 --retry-connrefused --waitretry=3s -c --limit-rate=2000000 --output-document=~/Downloads/test.file http://localhost/file/test.file
# If you want to stop retrying, say after 100 times, put "-t 100" instead of "-t 0"
# If it failed after 100th retries, the plan is you could save this command as failed download to a database,
# then possibly run a sweeper for failed downloads that ran every N minutes and retry it with the same command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment