mirror site to other servers

From WebHostingNeeds.com
Jump to: navigation, search

This is the command i run on file hosting site to keep mirrors of the site updated with changes in main site.


rsync -a -v --exclude-from=/root/exclude.txt --progress --timeout=0 -e "ssh -p 3333" /home/uploads [email protected]:/home/
rsync -a -v --exclude-from=/root/exclude.txt --progress --timeout=0 -e "ssh -p 3333" /home/uploads [email protected]:/home/
rsync -a -v --exclude-from=/root/exclude.txt --progress --timeout=0 -e "ssh -p 3333" /home/uploads [email protected]:/home/


File /root/exclude.txt contains files that do not need to be mirrored.


[[email protected] ~]# cat /root/exclude.txt
uploads/public_html/templates_c/*
uploads/public_html/files/*
uploads/public_html/include/config.php
uploads/pureftpd
[[email protected] ~]#


The process can be automate by running the commands in cronjob. This will need password less authentication, you can find more details on password less authentication at rsync rsa key login for remote backup