I downloading files using wget like this
wget http://www.example.com/mysql.zip -O mysql.zip
Then i have do stuff with that file.
But sometimes if there is error in url or somewhere then corrupted file mysql.zip
is placed in there and my script don't download the file as its already there and script fails.
Is there any way if mysql.zip
is only placed if file download is complete.
There are two cases when that can happen
- Url does not exist
- User manually cancels the download
IN both above cases i don't want the file to be there
wget
completes succesfully.