#-- Description: #-- This script is designed to create and 'rotate' the backup files for a particular #-- Directory. This script is probably being automatically run by the 'cron' daemon #-- at a frequency as specified in the /etc/crontab file. #-- #-- The third parameter, the 'backupFileBaseName' should not contain the 'tar.gz' #-- extension as this will be added by the script #-- #-- This script is incomplete # See Also: # # Author: # m.j.bishop if [ "$3" = "" ] then echo "usage: $0 theDirectoryToBackup theStorageDirectory backupFileBaseName" cat $0 | sed -n "/^[ ]*#/p" exit 1; fi directoryToBackup=$1 repositoryDirectory=$2 backupFileBaseName=$3 cd $repositoryDirectory for i in $(seq 7 -1 1); do let j=$i+1; cp vanessa-web.tar.gz.$i vanessa-web.tar.gz.$j; done; cd /home/vanessa/ tar -zcvf vanessa-web.tar.gz public_html cd /var/backups/guest-websites/vanessa/ cp vanessa-web.tar.gz vanessa-web.tar.gz.1 cp /home/vanessa/vanessa-web.tar.gz .