Hi Joe, Here is a shell script I inherited. Probably someone before me found it on a website for all I know. I do not fully understand it however just modify the rsync= line, modify the paths= area, and replace ServerNameGoesHere with the destination server. You may want to remove the MySql part. I'm guessing this works because there is a key in place already. #!/bin/bash # sync content to off-site systems [ -t 1 ] && v=vP rsync=( rsync -az$v -e "ssh -p 22" --bwlimit=2000 --delete-after ) paths=( /home # main thing to get sync'd /etc/php.ini # what if php.d is out of sync? # /etc/php.d # sync via yum somehow? # /var/lib/mysql # use replication instead /var/www/html # nothing here usually /var/www/cgi-* # cgiwrap and phpwrap # /var/lib/php/session # sessions will break anyway ) for path in "${paths[@]}" do [ -t 1 ] && echo "$path" "${rsync[@]}" "$path" ServerNameGoesHere:"${path%/*}/" & [ -t 1 ] && wait done # sync mysql to a backup folder (replication normally handles it) [ -t 1 ] && echo /var/lib/mysql "${rsync[@]}" /var/lib/mysql/ ServerNameGoesHere:/var/lib/mysql-rsync/ wait [ -t 1 ] || while pgrep -x rsync >/dev/null do echo rsync still running! sleep 10 done ------------------------ Keith Smith --- On Mon, 8/16/10, joe@actionline.com <joe@actionline.com> wrote:
|