Skip to content

Instantly share code, notes, and snippets.

@port19x
Last active April 11, 2024 13:01
Show Gist options
  • Save port19x/8a3160e83d8ebf3b85b84e06aa9ea115 to your computer and use it in GitHub Desktop.
Save port19x/8a3160e83d8ebf3b85b84e06aa9ea115 to your computer and use it in GitHub Desktop.
backup script
#!/bin/sh
a=$(date +%d.%m.%y)
du -shc "$HOME/git" "$HOME/doc" "$HOME/dotfiles" "$HOME/pic" "$HOME/.ssh" "$HOME/Passwords.kdbx"
printf "Is the backup small enough? (CTRL-C otherwise)"
read
echo "$a: initiating backup"
cd
mkdir "$a"
cp -r "git" "doc" "dotfiles" "pic" ".ssh" "Passwords.kdbx" "$a"
tar c -I"zstd -19 -T0" -f "$a.tar.zst" "$a"
gpg -c "$a.tar.zst"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment