old-www/LDP/sag/html/multi-level-backups.html

505 lines
7.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML
><HEAD
><TITLE
>Multilevel backups</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Linux System Administrators Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Backups"
HREF="backups-intro.html"><LINK
REL="PREVIOUS"
TITLE="Simple backups"
HREF="simple-backups.html"><LINK
REL="NEXT"
TITLE="What to back up"
HREF="what-to-backup.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux System Administrators Guide: </TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="simple-backups.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 12. Backups</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="what-to-backup.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="MULTI-LEVEL-BACKUPS"
></A
>12.5. Multilevel backups</H1
><P
> The simple backup method outlined in the previous section
is often quite adequate for personal use or small sites. For more
heavy duty use, multilevel backups are more appropriate. </P
><P
> The simple method has two backup levels: full and
incremental backups. This can be generalized to any number of
levels. A full backup would be level 0, and the different levels
of incremental backups levels 1, 2, 3, etc. At each incremental
backup level you back up everything that has changed since the
previous backup at the same or a previous level. </P
><P
> The purpose for doing this is that it allows a longer
<I
CLASS="GLOSSTERM"
>backup history</I
> cheaply. In the example in
the previous section, the backup history went back to the previous
full backup. This could be extended by having more tapes, but
only a week per new tape, which might be too expensive. A longer
backup history is useful, since deleted or corrupted files are
often not noticed for a long time. Even a version of a file that
is not very up to date is better than no file at all. </P
><P
> With multiple levels the backup history can be extended
more cheaply. For example, if we buy ten tapes, we could use
tapes 1 and 2 for monthly backups (first Friday each month),
tapes 3 to 6 for weekly backups (other Fridays; note that there
can be five Fridays in one month, so we need four more tapes),
and tapes 7 to 10 for daily backups (Monday to Thursday).
With only four more tapes, we've been able to extend the backup
history from two weeks (after all daily tapes have been used)
to two months. It is true that we can't restore every version
of each file during those two months, but what we can restore
is often good enough. </P
><P
><A
HREF="multi-level-backups.html#BACKUP-HISTORY-TIMELINE"
>Figure 12-1</A
> shows which backup
level is used each day, and which backups can be restored from
at the end of the month. </P
><DIV
CLASS="FIGURE"
><A
NAME="BACKUP-HISTORY-TIMELINE"
></A
><P
><B
>Figure 12-1. A sample multilevel backup schedule.</B
></P
><P
><IMG
SRC="backup-timeline.png"></P
></DIV
><P
> Backup levels can also be used to keep filesystem
restoration time to a minimum. If you have many incremental
backups with monotonously growing level numbers, you need to
restore all of them if you need to rebuild the whole filesystem.
Instead you can use level numbers that aren't monotonous, and
keep down the number of backups to restore. </P
><P
> To minimize the number of tapes needed to restore, you
could use a smaller level for each incremental tape. However,
then the time to make the backups increases (each backup copies
everything since the previous full backup). A better scheme is
suggested by the <B
CLASS="COMMAND"
>dump</B
> manual page and described
by the table XX (efficient-backup-levels). Use the following
succession of backup levels: 3, 2, 5, 4, 7, 6, 9, 8, 9, etc.
This keeps both the backup and restore times low. The most you
have to backup is two day's worth of work. The number of tapes
for a restore depends on how long you keep between full backups,
but it is less than in the simple schemes. </P
><DIV
CLASS="TABLE"
><A
NAME="EFFICIENT-BACKUP-LEVELS"
></A
><P
><B
>Table 12-1. Efficient backup scheme using many backup levels</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Tape</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Level</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Backup
(days)</TH
><TH
ALIGN="LEFT"
VALIGN="TOP"
>Restore
tapes</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>0</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>n/a</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>3</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1,
2</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>3</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1,
3</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>4</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>5</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
4</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>5</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>4</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>6</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>7</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 6</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>7</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>6</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 7</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>8</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>9</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 7, 8</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>9</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>8</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>2</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 7, 9</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>10</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>9</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 7, 9, 10</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>11</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>9</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1, 2,
5, 7, 9, 10,
11</TD
></TR
><TR
><TD
ALIGN="LEFT"
VALIGN="TOP"
>...</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>9</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1</TD
><TD
ALIGN="LEFT"
VALIGN="TOP"
>1,
2, 5, 7, 9, 10, 11,
...</TD
></TR
></TBODY
></TABLE
></DIV
><P
> A fancy scheme can reduce the amount of labor needed, but
it does mean there are more things to keep track of. You must
decide if it is worth it. </P
><P
> <B
CLASS="COMMAND"
>dump</B
> has built-in support for backup
levels. For <B
CLASS="COMMAND"
>tar</B
> and <B
CLASS="COMMAND"
>cpio</B
>
it must be implemented with shell scripts. </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="simple-backups.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="what-to-backup.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Simple backups</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="backups-intro.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>What to back up</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>