Backup Linux

Backup:

tar -cvpzf /backup-linux.tgz --warning=no-file-changed --exclude=/backup-linux.tgz --exclude=/backup-etc.tgz --exclude=/backup-var-www.tgz --exclude=/root/.bash_history --exclude=/home/foo/.bash_history --exclude=/root/swapfile --exclude=/build --exclude=/dev --exclude=/lost+found --exclude=/media --exclude=/mnt --exclude=/proc --exclude=/run --exclude=/sys --exclude=/var/cache --exclude=/var/log --exclude=/var/lib/apt/lists --exclude=/tmp /  

Restore:

tar -xvpzf /backup-linux.tgz -C /

history -c && history -w && reboot