#!/bin/bash -x SITE=$1 if [ -z "$SITE" ] then echo "no site supplied" exit fi echo SITE IS $SITE ACCOUNT=root@$SITE COMMAND="/bin/tar czf - /home " BACKUP_FOLDER=~/backup DATE=`date +%Y-%m-%d_%H-%M-%S` echo DATE IS $DATE DESTINATION=$BACKUP_FOLDER/$SITE/home_$DATE.tar.gz mkdir -p $BACKUP_FOLDER/$SITE/ /usr/bin/ssh $ACCOUNT $COMMAND > $DESTINATION echo DONE
No comments:
Post a Comment