Backup
rsync is an open source utility that provides fast incremental file transfer. You can use the following script for the rsync
mkdir /scripts
cd /scripts
ssh-keygen -t rsa -f mykey {press enterkey for the promoting )
vi backup.sh
REMOTE_USER=root
REMOTE_HOST=192.168.0.125
REMOTE_PATH=/var/lib/mysql
LOCAL_PATH=/backup1/
KEY_FILE=mykey
COMMAND=`which ssh`
echo $COMMAND
rsync --delete -avvvz -e "$COMMAND -i $KEY_FILE"
$REMOTE_USER@$REMOTE_HOST:$REMOTE_PATH $LOCAL_PATH
chmod u+x backup.sh
{be ensure the folder /backup1}is exist }
sh backup.sh
No comments:
Post a Comment