<repo_name>jasoneckert/shellscripts<file_sep>/script3.sh
#!/bin/bash
#This script backs up a directory specified by the first argument (positional parameter)
if [ $# -ne 1 ]
then 
echo "Usage is $0 <directory to back up>"
exit 255
fi

echo "Performing backup....."
sleep 3
tar -zcvf ~/backupfile.tar.gz $1

echo "Backup completed successfully to ~/backupfile.tar.gz"
<file_sep>/script4.sh
#!/bin/bash
#This script backs up a directory of your choice

echo -e "What directory do you want to back up?-->\c"
read ANS

echo "Performing backup....."
sleep 3
FILE=`echo $ANS | sed s#/#-#g`
DATE=`date +%F`
tar -zcvf ~/backup-$FILE-$DATE.tar.gz $ANS

echo "Backup completed successfully to ~/backup-$FILE-$DATE.tar.gz" 
<file_sep>/script2.sh
#!/bin/bash
#This script backs up a directory of your choice

echo -e "What directory do you want to back up?-->\c"
read ANS

echo "Performing backup....."
sleep 3
tar -zcvf ~/backupfile.tar.gz $ANS

echo "Backup completed successfully to ~/backupfile.tar.gz"
<file_sep>/script5.sh
#!/bin/bash
#This script backs up the Oracle DB every night

rm -f /remoteserver/backup-oracle*

if tar -zcvf /remoteserver/backup-oracle-`date +%F`.tar.gz /oracledb/*
  then
  echo "Oracle backup completed on `date`" >>/var/log/oraclebackuplog 

  else
  echo "Oracle backup failed on `date`" >>/var/log/oraclebackuplog
  mail -s "BACKUP FAILED" <EMAIL> </var/log/oraclebackuplog
fi
<file_sep>/script1.sh
#!/bin/bash
#This script creates a report of our disk configuration

FILENAME=`hostname`
echo "Disk report saved to $FILENAME.report"

echo -e "\n LVM Configuration: \n\n" >>$FILENAME.report
lvscan >>$FILENAME.report
vgscan >>$FILENAME.report
pvscan >>$FILENAME.report

echo -e "\n\n Partition Configuration: \n\n" >>$FILENAME.report
lsblk >>$FILENAME.report

echo -e "\n\n Mounted Filesystem Usage: \n\n" >>$FILENAME.report
df -hT | grep -v tmp >>$FILENAME.report
