Syncing a Running Production System to a Running Testing System

(Difference between revisions)
Jump to: navigation, search
(Created page with "Preliminary idea for copying the servers identically: <pre>sudo rsync --exclude=/proc --exclude=/sys --exclude=/root/.ssh/known_hosts \ --exclude=/etc/hosts --exclude=/etc/hostna...")
 
(Added What this does and Important Note)
Line 1: Line 1:
 +
== Code ==
 +
 
Preliminary idea for copying the servers identically:
 
Preliminary idea for copying the servers identically:
<pre>sudo rsync --exclude=/proc --exclude=/sys --exclude=/root/.ssh/known_hosts \
+
<pre>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:/ /</pre>
 
--exclude=/etc/hosts --exclude=/etc/hostname --exclude=/etc/network/interfaces root@ticc.mines.edu:/ /</pre>
 +
 +
== 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.

Revision as of 07:51, 21 February 2011

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