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
- url not exist
 - 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
Post a Comment