Created
December 16, 2009 13:50
-
-
Save umuro/257831 to your computer and use it in GitHub Desktop.
Backup LINUX
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
# Regularly execute this to have a nice difference backup | |
# No Restore. Backups of different dates will be available as if normal folders. | |
# Just use them normally. | |
# On each backup the list of apt-get installed applications are dumped so that | |
# they can be restored simply. You don't wast space to backup the whole system. | |
echo Getting package selections | |
dpkg --get-selections >/home/packages.txt | |
TGT=/media/Elements-1 #!!!! Define your backup target here !!!! | |
#-------- | |
T=/home | |
mkdir -p $TGT/Backup$T | |
echo Pruning backup of $T | |
rdiff-backup --remove-older-than 60D $TGT/Backup$T | |
echo Backing up $T | |
rdiff-backup -v5 --exclude /home/relocations --exclude /home/mnt_ex --exclude /home/relocations/var-spool --exclude /home/relocations/var/lock --exclude /home/relocations/var/run --exclude /home/relocations/var/tmp --exclude /home/mnt_ex/var/spool $T $TGT/Backup$T | |
#-------- | |
T=/etc | |
mkdir -p $TGT/Backup$T | |
echo Pruning backup of $T | |
rdiff-backup --remove-older-than 60D $TGT/Backup$T | |
echo Backing up $T | |
rdiff-backup -v5 $T $TGT/Backup$T | |
#-------- | |
T=/usr/local | |
mkdir -p $TGT/Backup$T | |
echo Pruning backup of $T | |
rdiff-backup --remove-older-than 60D $TGT/Backup$T | |
echo Backing up $T | |
rdiff-backup -v5 $T $TGT/Backup$T | |
#-------- | |
T=/opt | |
mkdir -p $TGT/Backup$T | |
echo Pruning backup of $T | |
rdiff-backup --remove-older-than 60D $TGT/Backup$T | |
echo Backing up $T | |
rdiff-backup -v5 $T $TGT/Backup$T |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment