Last active
December 15, 2015 00:49
-
-
Save baojie/5175293 to your computer and use it in GitHub Desktop.
backup entire file system Usage: bash <(curl -s https://gist.github.com/baojie/5175293/raw/cba116a7b3dae98626f775d31aef2301ce5e5ee9/tarall.sh)
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
#!bin/sh | |
# USAGE: | |
# bash <(curl -s https://gist.github.com/baojie/5175293/raw/cba116a7b3dae98626f775d31aef2301ce5e5ee9/tarall.sh) | |
# files to be excluded | |
cat > /tmp/exclude.txt << EOL | |
/dev | |
/tmp | |
/proc | |
/run | |
/sys/devices | |
/var/cache | |
EOL | |
# compress the entire file system into /tmp/whole.tar.gz, exclude file patterns given in exclude.txt | |
sudo tar -zcvf /tmp/whole.tar.gz -X /tmp/exclude.txt / | |
#scp /tmp/whole.tar.gz somehost:/path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment