~idmyn/dotfiles

dotfiles/backup.sh -rwxr-xr-x 1.0 KiB
243afa80 — David Mynors Set git pull to only fast-forward by default a day ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
set -euf

LOGFILE="${HOME}/.backup.log"

if [ ! -e "$LOGFILE" ] ; then
    touch "$LOGFILE"
fi

echo "Beginning backup at $(date)" >> "$LOGFILE"

. .backup.env

/usr/local/bin/restic backup ~       \
    --exclude="**/node_modules"      \
    --exclude="**/straight/repos"    \
    --exclude="${HOME}/desk"         \
    --exclude="${HOME}/files"        \
    --exclude="${HOME}/.asdf"        \
    --exclude="${HOME}/.cache"       \
    --exclude="${HOME}/.cargo"       \
    --exclude="${HOME}/.rustup"      \
    --exclude="${HOME}/.emacs.d"     \
    --exclude="${HOME}/.Trash"       \
    --exclude="${HOME}/Library"      \
    --exclude="${HOME}/Desktop"      \
    --exclude="${HOME}/Documents"    \
    --exclude="${HOME}/Applications" \
    --exclude="${HOME}/Pictures"     \
    --exclude="${HOME}/Public"       \
    --exclude="${HOME}/Movies"       \
    --exclude="${HOME}/Music"        \
    --exclude="${HOME}/Tresors"      \
    >> "$LOGFILE" 2>&1

printf "\n*******************************************************\n\n" >> "$LOGFILE"