aboutsummaryrefslogtreecommitdiff
path: root/Scripts/.local/scripts/do_backup
blob: 66321e3afba36122512b62e75b3624c0ac480736 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env sh

set -xe

dir="/media/hdd/backup/$(date +%F)/$(date +%T)"
folders="$HOME/Code $HOME/Dotfiles $HOME/Downloads $HOME/Media $HOME/Pictures $HOME/Projects $HOME/Text"

mkdir -p $dir

notify-send "do_backup: Starting backup (stored at $dir)"
for name in $folders
do
  out_name=$dir/$(basename $name).tar.xz
  XZ_OPT='-T0 -9' tar -Jcvf $out_name -C $name .
done
notify-send "do_backup: Finished backup"