I have a script
#Check the disk space before backups are taken
echo "Checking Disk Space"
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
echo $output
space=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $space -ge 90 ] && ["$partition" == "/tmp"];
then
echo "Running out of space \"$partition ($space%)\" on ($hostname) as of "`date +%D-%l`")" | mail -s "Alert: Almost out of disk space $space%"
exit 1
else
echo "Taking Backups"
cd $mixB
# tar command
cd $profiles
# mysqldump command
echo "Doing a git pull"
# git stuff
echo "Finishing touches"
# stuff
fi
echo "Checking if the website is up"
function test {
res=`curl -s -I $1 | grep HTTP/1.1 | awk {'print $2'}`
if [ $res -ne 200 ]
then
echo "Error $res on $1"
exit 1
fi
}
test http://www.google.com
After searching, it appears all of my if / fi tags are closed, and I didnt see any special characters when I did :set lists. Is there something obvious that I am missing? Those seem to be the two biggest causes of this e
Thanks