Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Managing Disks and Files
Backing Up Data
Chapter 6 691
NOTE Specify multiple values in a field by separating them with commas (no
spaces), as in 10,20,30.
The value * in any field represents all legal values.
Therefore, to schedule the ps command (see ps (1)) to execute at 5:10
p.m. (17:10) on every Friday and Monday during June, July, and August,
you would make an entry in your crontab input file that looks like this:
10 17 * 6,7,8 1,5 ps >> /tmp/psfile 2>&1
When using crontab, redirect any output that is normally sent to the
terminal to a file. In this example, 2>&1 redirects any error messages to
the file psfile.
An example backup strategy may consist of a full backup (performed
once per week) and an incremental daily backup. Assume that the
backups are to be performed at 4:03am and the media is DDS (DAT)
tape. The following crontab file implements the example backup
strategy:
3 4 * * 1 incrback >> monbackup
3 4 * * 2 incrback >> tuebackup
3 4 * * 3 incrback >> wedbackup
3 4 * * 4 incrback >> thubackup
3 4 * * 5 incrback >> fribackup
3 4 * * 6 fullback >> satbackupfull
In the above example incrback and fullback are example shell scripts.
Be sure to set the PATH variable appropriately or use complete paths to
any scripts that you include in the crontab input file. Scripts like these
may be used to:
• Warn any users who are logged in that the system is going down (for
backup purposes).
• Shutdown the system (to single user mode).
• Mount any file systems that you wish to back up.
• Run fbackup to perform the actual backup.
• Return the system to multiuser operating mode.
The output redirection can be specified in the crontab input file or
within the script contained in the crontab input file.