diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-01-04 15:37:44 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-01-04 15:37:44 +0000 |
commit | 05549329707b4f8ae14f718e50cdd7c41d15ed4a (patch) | |
tree | 9279ec443221da005b82948380768d13a736f7f3 /Scripts | |
parent | 9867c1029c72d799c348ea2b013a384ed23b2039 (diff) | |
download | dotfiles-05549329707b4f8ae14f718e50cdd7c41d15ed4a.tar.gz dotfiles-05549329707b4f8ae14f718e50cdd7c41d15ed4a.tar.bz2 dotfiles-05549329707b4f8ae14f718e50cdd7c41d15ed4a.zip |
backup script performs notify-send <=> X display is available
Diffstat (limited to 'Scripts')
-rwxr-xr-x | Scripts/.local/scripts/do_backup | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Scripts/.local/scripts/do_backup b/Scripts/.local/scripts/do_backup index de2db42..3f795ae 100755 --- a/Scripts/.local/scripts/do_backup +++ b/Scripts/.local/scripts/do_backup @@ -7,10 +7,22 @@ folders="$HOME/Dotfiles $HOME/Downloads $HOME/Media $HOME/Pictures $HOME/Project mkdir -p $dir -notify-send "do_backup: Starting backup (stored at $dir)" +if ! xset -q &> /dev/null +then + echo "do_backup: Starting backup (stored at $dir)" +else + notify-send "do_backup: Starting backup (stored at $dir)" +fi + 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" + +if ! xset -q &> /dev/null +then + echo "do_backup: Finished backup" +else + notify-send "do_backup: Finished backup" +fi |