From 7623f84405096aa6f701627e506048eb4c9983bc Mon Sep 17 00:00:00 2001 From: Petr Knap <8299754+petrknap@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:54:43 +0100 Subject: [PATCH] refactor: improved backup script --- roles/workstation/files/backup.bash | 15 +++++++++------ roles/workstation/tasks/main.yml | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/roles/workstation/files/backup.bash b/roles/workstation/files/backup.bash index 80df14c..dcc9065 100644 --- a/roles/workstation/files/backup.bash +++ b/roles/workstation/files/backup.bash @@ -6,11 +6,14 @@ then rm ~/backup.tmp fi -ls -aR ~/.apps > ~/.apps.ls || true -ls -aR ~/Downloads > ~/Downloads.ls || true -ls -aR ~/Videos > ~/Videos.ls || true -ls -aR ~/github.com > ~/github.com.ls || true -ls -aR ~/snap > ~/snap.ls || true +sudo tree \ + ~/.apps \ + ~/Downloads \ + ~/Videos \ + ~/github.com \ + ~/snap \ +> ~/excluded.tree + find ~ -maxdepth 1 \ -not -path ~/backup.tmp -not -path ~/backup.tar -not -path ~/backup.tar.xz -not -path ~/backup.tar.xz.gpg \ -not -path ~ \ @@ -29,7 +32,7 @@ find ~ -maxdepth 1 \ /etc \ ~/.apps/KeePass \ | gpg --verbose --symmetric --passphrase-file ~/backup.key --batch --output ~/backup.tmp \ -&& rm ~/*.ls +&& rm ~/excluded.tree if [ -e ~/backup.tar.xz.gpg ] then diff --git a/roles/workstation/tasks/main.yml b/roles/workstation/tasks/main.yml index 1e1e8d1..7a85bae 100644 --- a/roles/workstation/tasks/main.yml +++ b/roles/workstation/tasks/main.yml @@ -13,6 +13,7 @@ - make - mc - nano + - tree - name: Generate locales locale_gen: