#!/bin/bash

$DEST_IP=”10.10.10.10″

SOURCE_DIR=”/var/www/vhosts”
DEST_DIR=”/backups”
ARCHIVE_DIR=”archives”

clear

echo “Starting Archiving…”
echo

for i in $(find ${SOURCE_DIR} -type d -name httpdocs)
do

echo “Starting $(date)”

echo “Archiving ${i}”

echo “To        ${DEST_DIR}/${ARCHIVE_DIR}/$(date +%y%m%d)$(echo ${i} | sed ‘s/\//./g’).tgz”

tar zcf ${DEST_DIR}/${ARCHIVE_DIR}/$(date +%y%m%d)$(echo ${i}| sed ‘s/\//./g’).tgz ${i}
echo “Completed $(date)”

echo

done

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>