Last active
June 30, 2022 21:44
-
-
Save NiKiZe/51ea95706f9692123e2c3fe41c2eff32 to your computer and use it in GitHub Desktop.
Linux system backup
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
# from https://wiki.archlinux.org/title/Full_system_backup_with_tar | |
# -p, --acls and --xattrs store all permissions, ACLs and extended attributes. | |
# Without both of these, many programs will stop working! | |
# It is safe to remove the verbose (-v) flag. If you are using a | |
# slow terminal, this can greatly speed up the backup process. | |
#--exclude-from=$exclude_file | |
tar --exclude=/tmp/* --exclude=/var/tmp/* --exclude=/usr/portage/* --acls --xattrs --one-file-system -cpvf - . | xz -zvv -T3 -0 > file.xz | |
restore: | |
xz | tar --acls --xattrs --numeric-owner -xpf - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment