Syncing a Running Production System to a Running Testing System

From Physiki
Revision as of 07:51, 21 February 2011 by Zboerner (Talk | contribs)
Jump to: navigation, search

Code

Preliminary idea for copying the servers identically:

sudo rsync -avz --exclude=/proc --exclude=/sys --exclude=/root/.ssh/known_hosts \
--exclude=/etc/hosts --exclude=/etc/hostname --exclude=/etc/network/interfaces root@ticc.mines.edu:/ /

What this does

For a detailed overview of the commands involved with rsync, use man rsync.

The exclude commands are to exclude files that are not data files. They are all files that we felt did not need to be exact between the two servers since they deal either with temporary files or, in the case of the "known_hosts" file, involve files that should not be the same between the two. Otherwise, this should copy exactly the filesystem between the two.

Important Note

Right now this uses root! This is a bad idea and we've been circumventing issues by only temporarily allowing the root account the ability to log in or do anything. Future ideas involve creating an account solely for the purpose of syncing files that would have root-like access for copying.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox