Professional Documents
Culture Documents
1: Backing-up
To do this, become root with
Code:
sudo su
cd /
EDIT1:
tar cvpzf backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/backup.tgz --exclude=/mnt
--exclude=/sys /
OR
EDIT2:
tar cvpjf backup.tar.bz2 --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2
--exclude=/mnt --exclude=/sys /
2: Restoring
tar xvpfz backup.tgz -C /
Or
if you used bz2;
tar xvpfj backup.tar.bz2 -C /
WARNING: this will overwrite every single file on your partition with the one in the archive!
mkdir proc
mkdir lost+found
mkdir mnt
mkdir sys
etc...
http://ubuntuforums.org/showthread.php?t=35087
Backup up your Ubuntu server installation using the tar command via the terminal.
Two easy steps simplified
To Create the Backup Archive:
sudo tar -cvpzf yourbackupfilename.tar.gz --exclude=/path/to/backup/yourbackupfilename.tar.gz
--one-file-system /
In the last part of the command a single forward slash will backup the entire root directory, or you can
specify a certain directory to backup.
Restoring your backup:
sudo tar -xvpzf /path/to/yourbackupfilename.tar.gz -C /directory/to/restore/to --numeric-owner
If restoring a complete root directory backup the last section of this command would simply be a
forward slash /