linux - How to get wget only save file if its complete -


i downloading files using wget this

wget http://www.example.com/mysql.zip -o mysql.zip 

then have stuff file.

but if there error in url or somewhere corrupted file mysql.zip

is placed in there , script don't download file there , script fails.

is there way if mysql.zip placed if file download complete.

there 2 cases when can happen

  1. url not exist
  2. user manually cancels download

in both above cases don't want file there

what bash script:

#!/bin/bash if wget http://www.example.com/mysql.zip -o mysql.zip     # file else     rm mysql.zip fi 

Comments

Popular posts from this blog

java - Solr query version issue: Invalid version or the data in not in 'javabin' format -

Hard vs. Soft Water: What's The Difference?

The Ten Most Livable Cities In The World