Skip to content

Instantly share code, notes, and snippets.

@ppoffice
Last active September 2, 2022 19:20
Embed
What would you like to do?
Backup Linux using tar
#!/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