Last active
February 29, 2016 20:25
-
-
Save mcalhoun/49d207744bac301f9fd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXCLUDEFILE=/tmp/exclude.file | |
EXCLUDELIST='/boot /etc/fstab /etc/hostname /etc/issue /etc/hosts /etc/sudoers /etc/networks /etc/network/* /etc/resolv.conf /etc/ssh/* /etc/sysctl.conf /etc/mtab /etc/udev/rules.d/* /lock /net /tmp /var/cache/xenstore /opt/nimsoft' | |
EXCLUDEPATH=$(echo $EXCLUDELIST | sed 's/\ /\\n/g') | |
echo -e $EXCLUDEPATH > $EXCLUDEFILE | |
service apache2 stop | |
service activemq stop | |
service mysql stop | |
service mongod stop | |
service tomee stop | |
TARGETVM="X.X.X.X" | |
rsync -e "ssh" -rlpEAXogDtSzh -P -x --exclude-from="$EXCLUDEFILE" --rsync-path="sudo rsync" --verbose --progress / root@$TARGETVM:/ | |
rsync -e "ssh" -crlpEAXogDtSzh -P -x --exclude-from="$EXCLUDEFILE" --rsync-path="sudo rsync" --verbose --progress / root@$TARGETVM:/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment