Changes between Initial Version and Version 1 of full-filesystem-rsync


Ignore:
Timestamp:
Feb 8, 2012, 11:40:07 PM (14 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • full-filesystem-rsync

    v1 v1  
     1= Full Filesystem rsync =
     2
     3Sometimes we need to move an entire server from one machine to another machine.
     4
     5The first step is to boot the target guest from a debirf image, mount all filesystem in /mnt, and add the source server's ssh key into /root/.ssh/authorized_keys on the debirf image.
     6
     7Then, on the source, edit and run the following script:
     8
     9{{{
     10target=root@leslie.new:/mnt/
     11
     12# -a typically means: --recursive --links --perms --times --group --owner
     13# --devices --specials
     14# we don't use extended attributes normally (otheriwse, we might want -X)
     15# or ACLs (otherwise might consider -A)
     16
     17exclude="--exclude /etc/fstab --exlude /etc/network/interfaces /etc/udev/rules.d/*"
     18rsync -ax --hard-links --delete $exclude / "$target"
     19rsync -ax --hard-links --delete /srv "$target"
     20rsync -ax --hard-links --delete /var "$target"
     21}}}