Last active
September 2, 2022 19:20
-
-
Save ppoffice/6f9b02404516c894f82cc33c072c3130 to your computer and use it in GitHub Desktop.
Backup Linux using tar
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/bash | |
cd / | |
tar -cvpzf backup.tar.gz \ | |
--exclude=/backup.tar.gz \ | |
--exclude=/proc \ | |
--exclude=/tmp \ | |
--exclude=/mnt \ | |
--exclude=/dev \ | |
--exclude=/sys \ | |
--exclude=/run \ | |
--exclude=/media \ | |
--exclude=/lost+found \ | |
--exclude=/var/log \ | |
--exclude=/var/cache/apt/archives \ | |
--exclude=/usr/src/linux-headers* \ | |
--exclude=/home/*/.gvfs \ | |
--exclude=/home/*/.cache \ | |
--exclude=/home/*/.local/share/Trash \ | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment