Last active
October 30, 2021 16:42
-
-
Save okb1100/ae3a016f1de5f9f0ce2283d6808d565a to your computer and use it in GitHub Desktop.
#linux-stuff [Simple home directory backup script]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BACKUP_DATE=$(date +%s) | |
cd $HOME | |
mkdir -p DRIVE | |
BACKUP_SIZE=$(du -shc -X $HOME/EXCLUDE $HOME/* | sort -h | awk 'END{print $1}') | |
echo "Backup size: $BACKUP_SIZE" | |
tar cf - --exclude-from="EXCLUDE" $HOME \ | |
| pigz -9 \ | |
| gpg --encrypt -r backup@example.org \ | |
| split -b 1G - $HOME/DRIVE/BACKUP-$BACKUP_DATE.tar.gz.gpg.part |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/home/okb/YaDisk | |
/home/okb/lost+found | |
/home/okb/.cache | |
/home/okb/.ecryptfs | |
/home/okb/*.socket | |
/home/okb/.Trash-* | |
/home/okb/.local/share/Trash | |
/home/okb/.recycle | |
/home/okb/.config/chromium | |
/home/okb/.vagrant.d | |
/home/okb/.nuget | |
/home/okb/VirtualBox VMs | |
/home/okb/MEGA | |
/home/okb/DRIVE | |
/home/okb/.wine | |
/home/okb/*/node_modules | |
/home/okb/*/vendor | |
/home/okb/.npm | |
/home/okb/.local/share/NuGet | |
/home/okb/*/packages | |
/home/okb/.minecraft | |
/home/okb/BACKUP-* | |
/home/okb/.gnupg | |
/home/okb/.PhpStorm* | |
/home/okb/snap | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment