From d88430aa8a5a322e819fb7ccddffa1bd645b883c Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 6 Oct 2023 01:16:47 +0100 Subject: (Scripts|SystemD)~rework backup system This is purely for the desktop: only enable if you fix it up. --- Scripts/.local/scripts/create_backup | 3 +-- Scripts/.local/scripts/do_backup | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 Scripts/.local/scripts/do_backup (limited to 'Scripts/.local/scripts') diff --git a/Scripts/.local/scripts/create_backup b/Scripts/.local/scripts/create_backup index cde5a03..7a1309d 100755 --- a/Scripts/.local/scripts/create_backup +++ b/Scripts/.local/scripts/create_backup @@ -2,8 +2,7 @@ set -xe -dir=$2/backup -arch=$2/archive +dir=/media/hdd/backup name="$(date +%F)-$(date +%T)-$(basename $1).tar.xz" XZ_OPT='-T0 -9' tar -Jcvf $dir/$name $1 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 + -- cgit v1.2.3-13-gbd6f