sudo tar cvpzf /backup_`date '+%Y-%m-%d'`.tar.gz --exclude=/backup_`date '+%Y-%m-%d'`.tar.gz --one-file-system /
## -cvpzf
# c: new archive
# v: verbose (= shows an output while it is compressing)
# p: keep permissions inside the archive intact
# z: gzip compression mode. It is recommend against writing compressed data to
# tape, because if data on a portion of the tape becomes corrupted, you will
# lose your entire backup set
# f: allows to name the file
## /backup.tar.gz
# Destination and name of the backup archive.
## --exclude=/backup.tar.gz
# Prevent backup from being included in backup
## --one-file-system
# Exclude certain directories (e.g. prog, sys, run, deb, ...) that are generated
# dynamically by the running cernel
## /
# Path that we want to backup (entire root directory in this case)
sudo tar xvpzf /path/to/backup.tar.gz -C /directory/to/restore/to --numeric-owner
## /directory/to/restore/to
# Will overwrite already existing files