Skip to content

Instantly share code, notes, and snippets.

@justindav1s
Last active March 22, 2018 20:57
Show Gist options
  • Save justindav1s/c77c3e44f4808fd78defcd97374dd2e2 to your computer and use it in GitHub Desktop.
Save justindav1s/c77c3e44f4808fd78defcd97374dd2e2 to your computer and use it in GitHub Desktop.
Filesystem snapshot and restore using rsyn
snapshot / to /data1
rsync -avz \
--exclude '/dev' --exclude '/proc' --exclude '/sys' \
--exclude '/data2' --exclude '/data1' \
--exclude '/boot' --exclude '/run' \
/ /data1
tar zcvf backup_vanilla_220318.tar.gz srv/ mnt/ media/ lost+found/ usr/ sbin/ lib64/ lib bin/ opt/ home/ var/ etc/ root/ tmp/
time passes ....
tar zxvf backup_vanilla_220318.tar.gz
restore from /data1 to /
rsync -avz \
--exclude '/dev' --exclude '/proc' --exclude '/sys' \
--exclude '/data2' --exclude '/data1' \
--exclude '/boot' --exclude '/run' \
--delete \
/data1/ /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment