Files
dotfiles/bin/backup-home
T
artem 9978914b4d Backup: do not store unnecessary files
* "build" is a Gradle output directory
* node_modules, bower_components should be untouched
* .gradle has cached dependencies
2017-11-22 09:35:13 +01:00

27 lines
638 B
Bash
Executable File

#!/usr/bin/env bash
mkdir -p "$HOME/tmp"
exec >"$HOME/tmp/backup.log" 2>&1
ROUND="$(($(date +%_j) % 10))"
/bin/tar -cp \
--exclude-tag-all=purgefile \
--exclude="$HOME/pkg" \
--exclude="$HOME/tmp" \
--exclude="$HOME/Android/Sdk" \
--exclude="$HOME/Downloads" \
--exclude="$HOME/.android/avd" \
--exclude="$HOME/.cache" \
--exclude="$HOME/.wine" \
--exclude="$HOME/.gvfs" \
--exclude="$HOME/.npm" \
--exclude="$HOME/.local/share/Trash" \
--exclude=build \
--exclude=.gradle \
--exclude=node_modules \
--exclude=bower_components \
"$HOME" |
gsutil cp - \
"gs://backup-dasfoo-org/$(hostname)/$(whoami)/backup-$ROUND.tar"