Browse Source

new backup scheme

master
Yorick van Pelt 5 years ago
parent
commit
03cfefecfd
2 changed files with 38 additions and 21 deletions
  1. +7
    -21
      bin/backup.sh
  2. +31
    -0
      misc/dupignore

+ 7
- 21
bin/backup.sh View File

@ -1,8 +1,4 @@
#!/bin/sh
BACKUP_MACHINE="frumar.yori.cc"
DATE_FORMAT="+%Y-%m-%d"
BACKUP_DIR="/data/yorick/backup"
function is_locked() {
# check for lockfile
if [[ -f /tmp/rbs.lock ]]; then
@ -24,23 +20,13 @@ fi
rm -f /tmp/rbs.lock
echo $$ > /tmp/rbs.lock
echo "update local bup index..."
cd $HOME # do it here so that the bupignore paths work without rewriting
ionice -c3 bup index -u $HOME --xdev --exclude-from $HOME/dotfiles/misc/bupignore
# check if backup machine is available
#ping -w 5 -c 1 $BACKUP_MACHINE
#if [ $? -eq 0 ]; then
# start backup
echo "copy bup packs..."
branch="$(hostname)-$(date $DATE_FORMAT)"
ionice -c3 bup save -n $branch $HOME -r $BACKUP_MACHINE:$BACKUP_DIR/home/
#echo "verify bup packs..."
#cd $BACKUP_DIR/home
#ionice -c3 bup -d . fsck -g -vv
#fi
ionice -c3 duplicity /home/yorick \
webdavs://yorickvp@yorickvp.stackstorage.com/remote.php/webdav//$(hostname | head -c3)_bak \
--ssl-cacert-file /etc/ssl/certs/ca-bundle.crt \
--encrypt-key yorick \
--include-filelist ~/dotfiles/misc/dupignore \
--asynchronous-upload \
--volsize 100
# remove lockfile
rm -f /tmp/rbs.lock

+ 31
- 0
misc/dupignore View File

@ -0,0 +1,31 @@
- /home/yorick/projects/**/journal/prealloc.*
- /home/yorick/backups/*.zip.gpg
- /home/yorick/frumar
- /home/yorick/Downloads
- /home/yorick/media
- /home/yorick/annex
- /home/yorick/dotfiles
- /home/yorick/public
- /home/yorick/builds
- /home/yorick/tmp
- /home/yorick/VirtualBox VMs
+ /home/yorick/*/wallet.dat
+ /home/yorick/.electrum
+ /home/yorick/.gnupg
- /home/yorick/.config/Chromium
- /home/yorick/.config/sublime-text-2/Backup
- /home/yorick/.config/sublime-text-3/Backup
- /home/yorick/.config/VirtualBox
+ /home/yorick/.config/*
- /home/yorick/.mozilla/firefox/*/storage
- /home/yorick/.mozilla/firefox/*/epub
- /home/yorick/.mozilla/firefox/*/webappsstore.sqlite
+ /home/yorick/.mozilla/
- /home/yorick/ru/ext/
- /home/yorick/ru/netsec/netsec2015
- /home/yorick/ru/netsec/NetSec-Debian-root.vdi
- /home/yorick/ru/ossec/ossec2015
- /home/yorick/ru/**/lectures
- /home/yorick/ru/**/opnames
+ /home/yorick/ru/
- /home/yorick/.*

Loading…
Cancel
Save