Created
January 17, 2015 10:45
-
-
Save topu/00464e0a377efad8b978 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/sh | |
#TODO rsync over ssh | |
#TODO lvm snapshots | |
#TODO mounting external encrypted drive | |
#TODO rotating backups | |
#TODO initial backup (no 'current' link) | |
readonly PATHTOBACKUP=/mnt/backup | |
backup_local() { | |
local name=$1; shift | |
local sources=$@ | |
local destination=$PATHTOBACKUP/$name | |
local date=`date "+%Y-%m-%dT%H:%M:%S"` | |
rsync -aAXHS -v -x -R --numeric-ids --link-dest=$destination/current $sources $destination/back-$date | |
rm $destination/current && ln -s back-$date $destination/current | |
} | |
main() { | |
backup_local vostro / /boot /boot/efi | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment