Very simple Linux backup

Written by Peter Davies on .

This script will simply copy a series of files, tar and then gzip the files:

 
#!/bin/sh
# temporary backup script
Back_Dir="/root/scripts/backups" 
Vhosts_Dir="/home/httpd/vhosts" 
 
# get the date for the filename.
shdate=`date +%b%d%y`
 
# save our current directory location.
tmp_dir=$PWD
 
# change to the Backup file directory.
cd $Back_Dir
 
# create a gzip compressed tar file of the webs directory.
tar -czf ${shdate}.bak.tar.gz $Vhosts_Dir
 
# return to the previous working directory.
cd $tmp_dir
 
It might help a few users!