Skip to content

Instantly share code, notes, and snippets.

@neilellis
Last active December 15, 2015 01:08
Show Gist options
  • Save neilellis/5177434 to your computer and use it in GitHub Desktop.
Save neilellis/5177434 to your computer and use it in GitHub Desktop.
A simple script to rsync to a backup-server, use this script with caution and make sure the destination is disposable (and running same version of OS). If unsure add --dry-run into the rsync options. You will probably want to tailor rsync-exclude.txt to your needs.
rsync -azPx -e ssh -azPx --delete-after --exclude-from="rsync-exclude.txt" / root@$1:/
/.autofsck
/var
/boot
/proc
/sys
/tmp
/dev
/etc/aliases.db
/etc/digitalocean
/etc/fstab
/etc/blkid/
/etc/mdadm.conf
/etc/mtab
/etc/resolv.conf
/etc/conf.d/net
/etc/sysctl.conf
/etc/network/interfaces
/etc/networks
/etc/sysconfig/network*
/etc/sysconfig/hwconf
/etc/sysconfig/ip6tables-config
/etc/sysconfig/kernel
/etc/hostname
/etc/HOSTNAME
/etc/hosts
/etc/modprobe*
/etc/modules
/etc/udev
/etc/shadow
/net
/lib/modules
/etc/rc.conf
/etc/ssh/ssh_host*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment