diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-06 01:16:47 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-06 01:16:47 +0100 |
commit | d88430aa8a5a322e819fb7ccddffa1bd645b883c (patch) | |
tree | b3b1bfc030ac1d5c297ab44590b13931c558f985 /Scripts/.local/scripts/do_backup | |
parent | 9e975839fe0b98649549173fe04f9191226e0657 (diff) | |
download | dotfiles-d88430aa8a5a322e819fb7ccddffa1bd645b883c.tar.gz dotfiles-d88430aa8a5a322e819fb7ccddffa1bd645b883c.tar.bz2 dotfiles-d88430aa8a5a322e819fb7ccddffa1bd645b883c.zip |
(Scripts|SystemD)~rework backup system
This is purely for the desktop: only enable if you fix it up.
Diffstat (limited to 'Scripts/.local/scripts/do_backup')
-rwxr-xr-x | Scripts/.local/scripts/do_backup | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Scripts/.local/scripts/do_backup b/Scripts/.local/scripts/do_backup new file mode 100755 index 0000000..0d85694 --- /dev/null +++ b/Scripts/.local/scripts/do_backup @@ -0,0 +1,15 @@ +#!/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 + +for name in $folders +do + out_name=$dir/$(basename $name).tar.xz + XZ_OPT='-T0 -9' tar -Jcvf $out_name -C $name . +done + |