Wednesday, September 23, 2009

use cron and bash script rsync to synchronize two webroots (or any folder for that matter)

[root@cms ]# cat scripts/sync_cms_to_www1.sh
#!/bin/bash

echo syncing everything in webroot to www1 webroot
rsync -avzC --force --progress -e "ssh -i /keys/cron_dsa" --exclude-from=/usr/local/bin/scripts/rsync_excludes.txt /www/ username@slave_server_ip:/www/
echo done!

0 Comments:

Post a Comment

<< Home