Securing-Optimizing-RH-Linux-1_2_451
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
451
Making backups with tar
With six tapes you can make backups every day, the procedure is to use tape 1 for the first full
backup (Friday 1), and tapes 2 to 5 for the incremental backups (Monday through Thursday).
Then you make a new full backup on tape 6 (second Friday), and start doing incremental ones
with tapes 2 to 5 again. Its important to keep tape 1 on its state until you've got a new full backup
with tape 6. In the following example bellow, we assume that we write the backup to a tape SCSI
drive named (/dev/st0) and we backup the home directory (/home) of our system.
First of all, we must to move to the file system / partition. When creating an archive file, tar will
strip leading / (slash) characters from file path names. This means that restore files may not end
up in the same locations they were backed up from. Therefore, to solve the problem the solution
is to change to the / root directory before make all backup or all restore.
·
To move to the / root directory, use the command:
[root@deep]# cd /
It is important to always start with a full backup (say, on a Friday), for example:
·
Friday 1, (use tape 1 for the first full backup).
[root@deep /]# cd /
[root@deep /]# tar cpf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Monday, (use tapes 2 for the incremental backups).
[root@deep /]# cd /
[root@deep /]# tar cpNf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Tuesday, (use tapes 3 for the incremental backups).
[root@deep /]# cd /
[root@deep /]# tar cpNf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Wednesday, (use tapes 4 for the incremental backups).
[root@deep /]# cd /
[root@deep /]# tar cpNf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Thursday, (use tapes 5 for the incremental backups).
[root@deep /]# cd /
[root@deep /]# tar cpNf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Friday 2, (use tape 6 for the new full backups).
[root@deep /]# cd /
[root@deep /]# tar cpf /dev/st0 --label=" full-backup created on `date '+%d-%B-%Y'`." \
--directory / home
·
Now, start doing incremental ones with tapes 2 to 5 again and so on.
The c option specifies that an archive file is begin created.
The p option preserve permissions; file protection information will be remembered.
The N option done an incremental backup and only store files newer than DATE.
The f option states that the very next argument will be the name of the archive file or device being written.