SITE SEARCH  |
|
|
BACKUP
BASICS  |
|
|
|
OVERVIEW |
In a time
of explosive data growth and shrinking decision timeframes,
it's a simple, sobering truth:
"Your data is the most valuable asset your business
owns". Without it, people sit idle, your
network is inoperable, and your business goes dark. Every minute
and every megabyte has a cost.
Once your system is in use, your next consideration should be
backing up file systems, directories, & files. Files &
directories represent a significant investment of time &
effort. At the same time, all computer files are potentially
easy to change or erase, either intentionally or by accident.
If you take a careful & methodical approach to backing up
your file systems, you should always be able to restore recent
versions of files or file systems with little difficulty.
When a hard disk crashes, the information contained
on that disk is destroyed. The only way to recover the destroyed
data is to retrieve the information from your backup copy.
|
|
| |
TYPES
OF BACKUP |
There are
two methods of backing up large amounts of data:
-
Complete
system backup
-
Incremental
backup
To understand these two types of backups & which one is right
for a site or system, it is important to have an understanding
of file system structure & data placement. Once you have decided
on a strategy for data placement, you can develop a backup strategy
for that data. See "Implementing
Scheduled Backups" for an example of a backup
strategy that includes weekly complete system backups and daily
incremental backups |
|
| |
IMPLENTING
SCHEDULED BACKUPS |
This procedure
describes how to develop & use a script to perform a weekly
full backup & daily incremental backups
of user files. The script included in this procedure
is intended only as a model & should be carefully tailored
to your needs.
Prerequisites:
-
The
amount of data scheduled for backup cannot exceed one tape
when using this script
-
Make
sure the tape is loaded in the backup device before cron runs
the script
-
Make
sure the device is connected and available, especially when
using scripts that run at night. Use the following lsdev -C
| pg command to check availability
-
Make
sure the backup device has been cleaned recently to prevent
errors
-
If
you are backing up file systems that may be in use, you should
unmount them first to prevent file system corruption
-
Check
the file system before making the backup. Use the procedure
"Verifying a File System" or run the fsck command
Back
Up File Systems Using the cron Command:
This procedure describes how to write a crontab script
that you can pass to the cron command for execution. The script
backs up two user file systems, /home/plan and /home/run, on
Monday through Saturday nights. Both file systems are backed
up on one tape, and each morning a new tape is inserted for
the next night. The Monday night backups are full archives (level
0). The backups on Tuesday through Saturday are incremental
backups.
-
The
first step in making the crontab script is to issue the crontab
-e command. This opens an empty file where you can make the
entries that are submitted to cron for execution each night
(the default editor is vi).
crontab -e
-
The
following example shows the six crontab fields. Field 1 is
for the minute, field 2 is for the hour on a 24-hour clock,
field 3 is for the day of the month, and field 4 is for the
month of the year. Fields 3 and 4 contain an * (asterisk)
to show that the script should run every month on the day
specified in the day/wk field. Field 5 is for the day of the
week, and field 6 is for the shell command being run
min hr day/mo mo/yr day/wk shell command
0 2 * * 1 backup -0 -uf /dev/rmt0.1 /home/plan
The command line shown assumes that personnel at the site
are available to respond to prompts when appropriate. The
-0 (zero) flag for the backup command stands for level zero,
or full backup. The -u flag updates the backup record in the
/etc/dumpdates file and the f flag specifies the device name,
a raw magnetic tape device 0.1 as in the example above
-
Enter
a line similar to that in step 2 for each file system backed
up on a specific day. The following example shows a full script
that performs six days of backups on two file systems:
0 2 * * 1 backup -0 -uf/dev/rmt0.1 /home/plan
0 3 * * 1 backup -0 -uf/dev/rmt0.1 /home/run
0 2 * * 2 backup -1 -uf/dev/rmt0.1 /home/plan
0 3 * * 2 backup -1 -uf/dev/rmt0.1 /home/run
0 2 * * 3 backup -2 -uf/dev/rmt0.1 /home/plan
0 3 * * 3 backup -2 -uf/dev/rmt0.1 /home/run
0 2 * * 4 backup -3 -uf/dev/rmt0.1 /home/plan
0 3 * * 4 backup -3 -uf/dev/rmt0.1 /home/run
0 2 * * 5 backup -4 -uf/dev/rmt0.1 /home/plan
0 3 * * 5 backup -4 -uf/dev/rmt0.1 /home/run
0 2 * * 6 backup -5 -uf/dev/rmt0.1 /home/plan
0 3 * * 6 backup -5 -uf/dev/rmt0.1 /home/run
-
Save
the file you created and exit the editor. The operating system
passes the crontab file to cron
|
|
| |
|
|