Hi All,
I was wondering if someone would be able to check my script....
I am wishing to download a file from the mater website, if that website or file is not present, it will redirect to a backup server - and try and source the file from there
Bash Script....
Code:
/usr/bin/wget https://drive.google.com/drive/path/here/$FILE1 || \
/usr/bin/wget http://www.second.webserver/$FILE2 \\ error 1
if [ -f $FILE1 ]; then
echo ".... SUCCESS !!! $FILE1 downloaded from Master Site....."
else
[ -f $FILE2 ] then
echo ".... SUCCESS !!! $FILE2 downloaded from backup site....."
fi
exit 0;;
The Google address is proving temperamental (must be missing something in the URL), but I am having issues trying to checking which File was downloaded in the IF/FI statement so that when whichever file was downloaded - the correct statement was displayed
Thought to give it a try, but I am going around in circles to find out what is wrong and missing.
Would curl be a better option than wget for the download?
Code:
/usr/bin/curl -sSkLo $FILE1 https://drive.google.com/drive/path/here/$FILE1 || \
/usr/bin/curl -sSkLo $FILE2 http://www.second.webserver/$FILE2 || error 1
if [ -f $FILE1 ]; then
echo ".... SUCCESS !!! $FILE1 downloaded from Master Site....."
else
[ -f $FILE2 ] then
echo ".... SUCCESS !!! $FILE2 downloaded from backup site....."
fi
exit 0;;
What part is fowling up?