Skip to content

Instantly share code, notes, and snippets.

@port19x
Last active October 31, 2025 14:09
Show Gist options
  • Select an option

  • Save port19x/8a3160e83d8ebf3b85b84e06aa9ea115 to your computer and use it in GitHub Desktop.

Select an option

Save port19x/8a3160e83d8ebf3b85b84e06aa9ea115 to your computer and use it in GitHub Desktop.
backup script
#!/bin/bash
a=$(date +%d.%m.%y)
du -shc "$HOME/Documents" "$HOME/Pictures" "$HOME/.ssh" "$HOME/Passwords.kdbx" "$HOME/.var/app/io.gitlab.librewolf-community/.librewolf/uw04bqn3.default-default"
printf "Is the backup small enough? (CTRL-C otherwise)"
read
echo "$a: initiating backup"
cd
mkdir "$a"
cp -r "Documents" "Pictures" ".ssh" "Passwords.kdbx" ".config/BraveSoftware/Brave-Browser/Default/" ".var/app/io.gitlab.librewolf-community/.librewolf/uw04bqn3.default-default" "$a"
tar -cf "$a.tar" "$a"
zstd -19 -T0 "$a.tar"
gpg -c "$a.tar.zst"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment