I have a script which downloads like 10 xml files from free feed hosting site.
And script has something like this
Code:
wget http://www.feedurl.com/rss.xml
mv rss.xml filename.xml
wget http://www.feedurl.com/filename.xml
etc.
some of them are named rss.xml and I can't change that so I use mv to rename them to what I need them to be named. Some of them I don't need renaming so they are downloaded as is.
But the problem is that this feed hosting site has high loads often and outputs just error instead of the feed. And if I try to download same feed like 10 seconds later it will work sometimes.
The problem is I can't check on it all the time if it downloaded them all ok or got some errors.
So I was wondering is there a way and how. To include like error search in the script so that it searches the rss.xml or filename.xml for errors after it is downloaded and if it finds errors to repeat download with 10 seconds delay. This is part of the error that is written in files if they weren't retrieved properly:
Code:
The remote server returned an error
so I was hoping to set up something like search for the above and if found repeat
Code:
wget wget http://www.feedurl.com/rss.xml
after 10 seconds.
but I have no idea what commands would do that if possible at all.
And would the rest of the script wait for first process to finish before continuing or would I have to split each file in separate script.
Thanks in advance and thx for all helpful replies on my previous threads.