#!/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
ROOTID=0 # Declaration of ROOD ID
INCLUDE="/home/nilcom/etc/backup_included_files" # List of files to be included in backup
EXLUDE="/home/nilcom/etc/backup_excluded_files" # List of files to be excluded from backup
HOSTNAME=`hostname -s` # Get hostname
DOW=`date +%a` # Day of the week, eg Monday
DOM=`date +%d` # Date of the month, eg 01 Sep
TAR=/bin/tar
#MONTHLY BACKUP
if [ $DOM = "17" ]; then
$TAR -cvjPf /tmp/ComprehensiveBackupMonth$DOM-$HOSTNAME.tar.bz2 -T $INCLUDE -X $EXCLUDE
echo "Backing Up Monthly"
fi
#WEEKLY BACKUP
if [ $DOW = "Sun" ]; then
$TAR -cvjPf /tmp/ComprehensiveBackupWeek$DOM-$HOSTNAME.tar.bz2 -T $INCLUDE -X $EXCLUDE
echo "Backing Up Weekly"
fi