Created
May 17, 2020 15:06
-
-
Save jj11hh/c08bde20f628f842ed248fc2881f7e62 to your computer and use it in GitHub Desktop.
backup ubuntu system to another partition
This file contains hidden or 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 / # THIS CD IS IMPORTANT THE FOLLOWING LONG COMMAND IS RUN FROM / | |
| mount /dev/nvme0n1p9 /mnt || exit 1 | |
| tar -cvpzf /mnt/backup-$(date +%F_%H%M%S).tar.gz \ | |
| --exclude=/proc \ | |
| --exclude=/tmp \ | |
| --exclude=/mnt \ | |
| --exclude=/dev \ | |
| --exclude=/sys \ | |
| --exclude=/run \ | |
| --exclude=/media \ | |
| --exclude=/var/log \ | |
| --exclude=/var/cache/apt/archives \ | |
| --exclude=/usr/src/linux-headers* \ | |
| --exclude=/home\ | |
| --exclude=/boot/efi\ | |
| --exclude=/snap / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment