Posts Tagged NTFS

Backup Takanga… RHEL v5.5… Sounds like a dance?


Well what a surprise and well kind of an embarrassment I faced the last 2 days…  I guess I have gotten pretty lazy these days as I wouldn’t have expected to miss this one, but I did.  I was building a new system for a customer upgrade and they selected RHEL v5.5 as the platform… Cool.  So as usual I sent in my request to our Dell “Gold_Team” rep with specs of what I wanted for this build.  Nothing fancy, a nice PowerEdge T410, dual quadcore procs, 8GB RAM, RAID1 (Perc6i of course) and the infamous RD1000 internal tape drive.  Now I posed the question because I am, well lazy, inquiring to include Symantec’s 2010 Backup EXEC application if it in fact runs on a Linux server.  Well that’s all it took to screw things up a bit.  I guess this can go either way, but what they shipped was the remote Linux agent for Symantec backup EXEC due to the fact (which they failed in let us know) that Backup EXEC does NOT run natively on any Linux platform as a standalone master server.  Great… I guess I should have known and shame on me for wanting a commercial app to run on Linux, but hey… I also didn’t know that the tapes for the drive are NTFS formatted by default and of course Linux cannot play with that filesystem formatting, but nothing a little fdisk-ing couldn’t fix… I am waiting for a quote back from Dell on their NetBackup 7.0.1 product (Also from Symantec…LOL)

, but I think it will be overkill to say the least for 1 server.  So in the interim, I whipped up a temp fix in the event that we opt for nothing…

Here is what I came up with:

#!/bin/bash
# A straight forward system backup script
#
LOGBASE=/var/log/backup/log
#BACKUP_ROOT_DIR=”a boot var etc”                       ## Backup dirs; do not prefix /
BACKUP_ROOT_DIR=”a”                     ## Backup dirs; do not prefix /
NOW=$(date +”%a”)                                       ## Get todays day
TSTAMP=$(date +”%l:%M:%S”)                              ## Get time stamp H:M:S
TDATE=$(date -I)                                        ## Get todays date
TAPE=”/dev/sdb1″                                        ## Backup device name
TAR_ARGS=””                                             ## Exclude file
EXCLUDE_CONF=/root/.backup.exclude.conf                 ## Named file for file exclusion
LOGFILE=$LOGBASE/$TDATE.backup.log                      ## Backup Log file
FILELIST=$LOGBASE/$TDATE.backup.file-listing.log        ## Backup Log file list
# Path to binaries
TAR=/bin/tar
MKDIR=/bin/mkdir
#
full_backup(){
local old=$(pwd)
cd /
$TAR $TAR_ARGS -cvpf $TAPE $BACKUP_ROOT_DIR
cd $old
}
# Make sure all dirs exits
verify_backup_dirs(){
local s=0
for d in $BACKUP_ROOT_DIR
do
if [ ! -d /$d ];
then
echo “Error : /$d directory does not exit!”
s=1
fi
done
# if not; just die
[ $s -eq 1 ] && exit 1
}
# Make some kind of status report
report_backup_info(){
touch $LOGBASE/$TDATE.backup.file-listing.log
echo ”                                                                         ”
echo ” ————————————————————————- ”
echo “|                                                                         |”
echo ”  Backup start time: $TSTAMP                                               ”
echo ”  Operating System: `cat /etc/redhat-release`                              ”
echo ”  Size of the complete archive: `tar -tvf /dev/sdb1|wc -c` Bytes           ”
echo ”  Size of the logged archive: `cat $FILELIST|wc -c` Bytes                  ”
echo ”  File count of the completed archive: `tar -tvf /dev/sdb1|wc -l` Files    ”
echo ”  File count of the logged archive: `cat $FILELIST|wc -l` Files            ”
echo “|                                                                         |”
echo ” ————————————————————————- ”
echo ”                                                                           ”
} > $LOGFILE 2>&1
#
#### MAIN ####
#
# Make sure log dir exits
[ ! -d $LOGBASE ] && $MKDIR -p $LOGBASE
#
# Verify dirs
verify_backup_dirs
#
#
# Okay let us start backup procedure
# If it is Monday-Friday make a full backup;
# Weekend no backups
case $NOW in
Mon|Tue|Wed|Thu|Fri)    full_backup;;
*) ;;
esac > $FILELIST 2>&1
# make the simple report
report_backup_info

Ahhh… The “Ghetto-scripts” live on… 🙂

This is the output that I guess I could send in an email blast:

————————————————————————-
|                                                                                                                       |
Backup start time:  9:27:36
Operating System: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
Size of the complete archive: 4295 Bytes
Size of the logged archive: 4295 Bytes
File count of the completed archive: 93 Files
File count of the logged archive: 93 Files
|                                                                                                                       |
————————————————————————-

, , , , , , , , ,

2 Comments