Skip to content

Commit

Permalink
refactor: improved backup script
Browse files Browse the repository at this point in the history
  • Loading branch information
petrknap committed Nov 21, 2023
1 parent c243fa8 commit 7623f84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
15 changes: 9 additions & 6 deletions roles/workstation/files/backup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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 ~ \
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions roles/workstation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- make
- mc
- nano
- tree

- name: Generate locales
locale_gen:
Expand Down

0 comments on commit 7623f84

Please sign in to comment.