Linux Backup Script
Linux Backup Script
Other script
#!/bin/bash
# A UNIX / Linux shell script to backup dirs to tape device like /dev/st0
(linux)
# This script make both full and incremental backups.
# You need at two sets of five tapes. Label each tape as Mon, Tue, Wed, Thu and
Fri.
# You can run script at midnight or early morning each day using cronjons.
# The operator or sys admin can replace the tape every day after the script has
done.
# Script must run as root or configure permission via sudo.
# ------------------------------------------------------------------------# Copyright (c) 1999 Vivek Gite <[email protected]>
# This script is licensed under GNU GPL version 2.0 or above
# ------------------------------------------------------------------------# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# ------------------------------------------------------------------------# Last updated on : March-2003 - Added log file support.
# Last updated on : Feb-2007 - Added support for excluding files / dirs.
# ------------------------------------------------------------------------LOGBASE=/root/backup/log
# Backup dirs; do not prefix /
BACKUP_ROOT_DIR="home sales"
# Get todays day like Mon, Tue and so on
NOW=$(date +"%a")
# Tape devie name
TAPE="/dev/st0"
# Exclude file
TAR_ARGS=""
EXCLUDE_CONF=/root/.backup.exclude.conf
# Backup Log file
LOGFIILE=$LOGBASE/$NOW.backup.log
# Path to binaries
TAR=/bin/tar
MT=/bin/mt
MKDIR=/bin/mkdir
#
#
#
#
#
#
#
[
*) ;;
esac > $LOGFILE 2>&1