Skip to content

Instantly share code, notes, and snippets.

@feklee
Last active September 5, 2024 11:30
Show Gist options
  • Save feklee/9e2932734fd96d5782c161c713c05e0b to your computer and use it in GitHub Desktop.
Save feklee/9e2932734fd96d5782c161c713c05e0b to your computer and use it in GitHub Desktop.
Creates a backup of linux.f76.eu
#!/bin/sh
# Creates a backup of my machine: linux.f76.eu
# Felix E. Klee <[email protected]>
LANG="en_US" # Sets locale to US english
BACKUP_DIR=~/"Syncthing/temp_backup/Internet/linux.f76.eu/"
BACKUP_FILE="backup.tar.gpg"
echo "Making backup to"
echo " $BACKUP_FILE"
echo "..."
sudo tar c \
--one-file-system \
--exclude=/var/cache --exclude=/var/tmp --exclude=/var/lock \
--exclude=/var/run/home --exclude=/home/felix/src \
--exclude=/home/felix/.dropbox-dist --exclude=/home/felix/.dropbox \
--exclude=/home/felix/.cache \
/etc /root /srv /var /home | \
gpg -e -r [email protected] >"$BACKUP_DIR/$BACKUP_FILE"
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment