Skip to content

Instantly share code, notes, and snippets.

@bchewy
Created February 2, 2019 08:39
Show Gist options
  • Save bchewy/2917a8a4076a0ef170287af50d85fc51 to your computer and use it in GitHub Desktop.
Save bchewy/2917a8a4076a0ef170287af50d85fc51 to your computer and use it in GitHub Desktop.
#!/bin/bash
# NAME: full-backup
# PATH: $HOME/bin
# DESC: Full system backup - must call with SUDO
# DATE: July 16, 2017. Modified July 26, 2017.
apt autoclean # reduces size of /var/cache/apt/archives
cd /tmp # tar must be created in directory not backed up.
time tar -cvpzf backup.tar.gz \
--exclude=/backup.tar.gz \
--exclude=/proc \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/dev \
--exclude=/sys \
--exclude=/media \
--exclude=/usr/src/linux-headers* \
--exclude=/home/rick/.cache \
--exclude=/var/log \
--exclude=/var/run/ \
--exclude=/run \
--exclude=/var/cache/apt/archives /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment