UnixServerAdmin

Server Administration & Management

yum_update.sh

#######################################################
# yum_update.sh ##
#######################################################
# Make a Directory /REPORTS ##
# Make a file msg6.txt under /REPORTS Directory ##
# Write Following in msg6.txt file ##
#######################################################
# Hi, ##
# The Operating and Patch Update process of the server has been completed. ##
# For Server update Report, Please check the attached yum_update Report. ###
# Thanks & Regards, ##
# Unixserveradmin.com Security Team ##
#######################################################
#! /bin/bash
/bin/mkdir /REPORTS 2> /dev/null
/bin/echo “####################################” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “– MONTHLY SERVER UPDATE REPORT FOR $(/bin/hostname | tr ‘a-z’ ‘A-Z’) –” > /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “– DATE : $(date) –” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “#################################” >> /REPORTS/Yum_Update_$(date +%d%m%y).txts
/usr/bin/yum update -y >>  /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “Thanks & Regards” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo “Unixserveradmin.com Security Team” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt
/bin/echo ”                                                            ” >> /REPORTS/Yum_Update_$(date +%d%m%y).txt

mutt -s “SERVER UPDATE REPORT $(hostname | tr ‘a-z’ ‘A-Z’)” -a /REPORTS/Yum_Update_$(date +%d%m%y).txt unixserv@unixserveradmin.com info@unixserveradmin.com < /REPORTS/msg6.txt

September 24, 2012 Posted by | Shell Script | | Leave a comment