Created
May 5, 2014 15:36
-
-
Save jedie/be43421f351374b28d96 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
#!/bin/bash | |
DEST_PATH="/media/your/external/mount/" | |
RELEASE=$(cat /etc/debian_version | python -c "import sys;print sys.stdin.read().split('/')[0]") | |
FILENAME="$(date +%Y-%m-%d) $(uname -nr) ${RELEASE} Backup.tar.lzma" | |
FILENAME=$(echo ${FILENAME} | tr " " "_") | |
DESTINATION=${DEST_PATH}${FILENAME} | |
EXCLUDE=" | |
--exclude=/dev/* | |
--exclude=/proc/* | |
--exclude=/sys/* | |
--exclude=/media/* | |
--exclude=/mnt/* | |
--exclude=/run/* | |
--exclude=/tmp/* | |
--exclude=/lost+found/* | |
--exclude=/var/cache/* | |
--exclude=/var/lib/apt/lists/*dists* | |
--exclude=/var/run/* | |
--exclude=/var/tmp/* | |
--exclude=/var/log/* | |
--exclude=/.Trash* | |
--exclude=*.tmp | |
--exclude=*.pyc | |
" | |
set -x | |
sudo tar cvpfa ${DESTINATION} ${EXCLUDE} / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment