Linux Backups

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!

pdavies | Linux Backups | 18 June, 1:10am | Comment on this

Category Cloud

Link Dump Tag Cloud