FS
Documentation

Backup3G/User Guide/Setting Up Backups

From Documentation

(Difference between revisions)
Jump to: navigation, search
Revision as of 09:13, 20 April 2006
Moff (Talk | contribs)
(To Define Information About a Backup Job)
← Previous diff
Revision as of 09:35, 20 April 2006
Moff (Talk | contribs)
(To Define Information About a Backup Job)
Next diff →
Line 102: Line 102:
#;Description: Appears in the duty schedule, so make it meaningful to help users to choose the right backup job. #;Description: Appears in the duty schedule, so make it meaningful to help users to choose the right backup job.
#;Mode: Select the default method for running this job: #;Mode: Select the default method for running this job:
-#::''scheduled'' - if the job will run to a regular schedule and requires some operator action (such as loading a tape)+#:''scheduled'' - if the job will run to a regular schedule and requires some operator action (such as loading a tape)
-#::''automatic'' - if it will be run as an automatic duty (that is, at a set time without user intervention)+#:''automatic'' - if it will be run as an automatic duty (that is, at a set time without user intervention)
-#::''request'' - if there is no regular schedule—the job will be run as required.+#:''request'' - if there is no regular schedule—the job will be run as required.
#;Auto-acknowledge: You may wish to avoid operators having to manually acknowledge completion of the job. The options are: #;Auto-acknowledge: You may wish to avoid operators having to manually acknowledge completion of the job. The options are:
-#::''onsuccess'' - automatically acknowledge this job if it finishes successfully (return status 0). This is the default.+#:''onsuccess'' - automatically acknowledge this job if it finishes successfully (return status 0). This is the default.
-#::''never'' - an operator must always manually acknowledge this job whatever its return status.+#:''never'' - an operator must always manually acknowledge this job whatever its return status.
-#::''always'' - always automatically acknowledge this job. If you choose this, you must use some other way to warn if this backup fails, such as an At-end command that sends mail to an administrator when the job returns a non-zero exit status.+#:''always'' - always automatically acknowledge this job. If you choose this, you must use some other way to warn if this backup fails, such as an At-end command that sends mail to an administrator when the job returns a non-zero exit status.
Line 117: Line 117:
Automatic backups start running as soon as they are initiated. Scheduled backups appear on the operator’s list of outstanding backups for the period specified in Run Time(s), and start running at the time you specify in the Day and Time fields. Automatic backups start running as soon as they are initiated. Scheduled backups appear on the operator’s list of outstanding backups for the period specified in Run Time(s), and start running at the time you specify in the Day and Time fields.
;When: Select the day(s) on which the job is to be run. ;When: Select the day(s) on which the job is to be run.
-;Run Time(s): automatic backup: enter the time of day when the backup should run.+;Run Time(s): ''automatic backup:'' enter the time of day when the backup should run. Examples:
-Examples:+::08:00        start the job at 8 am
-08:00 start the job at 8 am+::08,11:00   start the job at 8 am and 11 am
-08,11:00 start the job at 8 am and 11 am+::08-10:30   start the job at 8.30 am, 9.30 am, and 10.30 am
-08-10:30 start the job at 8.30 am, 9.30 am, and 10.30 am+:''scheduled backup:'' enter the time period during which the job should be initiated by an operator. Examples:
-scheduled backup: enter the time period during which the job should be initiated by an operator. Examples:+::<blank>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all day
-<blank> all day+::08:00-14:30&nbsp;&nbsp;&nbsp;between 8 am and 2.30 pm
-08:00-14:30 between 8 am and 2.30 pm+::-08:00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from midnight to 8 am
--08:00 from midnight to 8 am+::08:00-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from 8 am to midnight
-08:00- from 8 am to midnight+
;If not done?: (scheduled backups only) select what action to take if the job has not been started by the end of the scheduled time: ;If not done?: (scheduled backups only) select what action to take if the job has not been started by the end of the scheduled time:
-abandon remove the job from the list of outstanding backups. It will not reappear until the next time the backup is scheduled.+::''abandon'' - remove the job from the list of outstanding backups. It will not reappear until the next time the backup is scheduled.
-outstanding leave the job on the list of outstanding backups. It will stay outstanding until it is performed.+::''outstanding'' - leave the job on the list of outstanding backups. It will stay outstanding until it is performed.
The next three fields specify the drive that will write the backup; how long the backup will be kept; and if it will be stored offsite, the location. The next three fields specify the drive that will write the backup; how long the backup will be kept; and if it will be stored offsite, the location.
Line 141: Line 140:
You can tell backup3G to run a command at the start or end of the job, or when the volume is unloaded from the drive. Press Backup cmd(s) to enter one or more of these commands. You can tell backup3G to run a command at the start or end of the job, or when the volume is unloaded from the drive. Press Backup cmd(s) to enter one or more of these commands.
-Figure 14 — Defining commands to be run with the backup job+ Figure 14 — Defining commands to be run with the backup job
The At-start cmd runs before the first backup step. Example: bring down a database before backing it up. The At-start cmd runs before the first backup step. Example: bring down a database before backing it up.
Line 156: Line 155:
Scheduled backups may be initiated hours or days before they are due to run. For example, on Friday afternoon operators may submit scheduled backups to run on Saturday night. In the When and Run Time(s) fields you specified when this backup should be initiated. Now you will enter the Day and Time when the job should start. Scheduled backups may be initiated hours or days before they are due to run. For example, on Friday afternoon operators may submit scheduled backups to run on Saturday night. In the When and Run Time(s) fields you specified when this backup should be initiated. Now you will enter the Day and Time when the job should start.
-Figure 15 — Run day and time for a scheduled backup+ Figure 15 — Run day and time for a scheduled backup
;Day: Select a day of the week, or select ‘Next 24hrs’ to have the job run within 24 hours from when it is scheduled. ;Day: Select a day of the week, or select ‘Next 24hrs’ to have the job run within 24 hours from when it is scheduled.

Revision as of 09:35, 20 April 2006

The initial configuration procedure includes a task to automatically generate a weekly schedule of filesystem backups (see Generate Simple Backup Scheme on page 149). You can expand the basic schedule by adding new jobs and backup items to back up other data objects.

This section describes the process of defining backup jobs, including:

Background information on all of these topics can be found in Information on Backup Jobs on page 19.


Contents

How to Define a Backup Item

A backup item describes the ‘what’ and ‘how’ of a backup. It identifies a directory or filesystem on one host, and the method that will be used to back it up. One backup item maps to one step in a backup job.

A directory name can appear several times in the list of backup items, so that you have the choice of using different backup methods and of whether to keep an online index.


When not to create an online index

Online indexes may take up large amounts of disk space. You may choose not to create an index if the filesystem is very large or if you don’t expect to perform selected file recovery. For backups created using FScpio or FStar, an index can be created later from the backup volume.

If you want to index some backups but not others, define one item with Index=yes and one with Index=no.


Passing optional arguments to the backup method

You can use the Options field to pass extra flags and arguments to the backup command. These options are not validated when you define the backup item but are simply passed to the backup method to be evaluated at run time. See Passing Options to a Backup Method on page 163.


To define a backup item

  1. Select backup3G configuration > Maintain backup jobs, then select Items > Maintain to display the list of previously defined backup items, then select Maintain > Add.
    Item
    Defaults to one more than the current highest item number. You can change it to any unused item number, but it is recommended that you accept the default.
    Object
    Enter the name of the data object (filesystem or directory) to be backed up. For an image backup of a disk partition, enter the raw disk device name here. Make sure that the name is correct, as backup3G doesn’t check that the object exists at this point. Leave the field blank if this item will be used in a non-backup step.
    Except for backup3G variables such as $APPL_HOME and $APPL_DB, you should not use environment variables in this field. Reason: if on a remote host the variable is not set or is set to a different value, the directory name will be expanded incorrectly. Examples:
    Correct     /users/jemima/mail
                    $APPL_HOME
    Incorrect   $HOME/mail
    Host
    Select the host on which the directory is stored. If you want to back up a directory on multiple hosts, you must define a separate backup item for each.
    Method
    Press Choose to list the backup methods. Scroll to the right to see the attributes supported by each method, such as online indexes, remote backup, and multi-part backups.
    Index
    Enter ‘yes’ if you want an online index to be created when this item is backed up. If the backup method doesn’t support indexes, this field will automatically be set to ‘no’.
    Options
    Enter any optional flags and arguments to be passed to the backup method at run time.
    Comment
    Enter a descriptive comment.
    On error
    Should the backup job continue if this step fails? Select ‘continue’ if the job should continue after an error in this step. Select ‘abort’ if the job should not continue.
  2. Press Accept to save this item.



Note
Use double quotes around file patterns in Options to ensure that they are parsed correctly.


Example: single part backup step

Define an item to take a full backup of the directory /usr/home on your host machine (use a different directory name if /usr/home doesn’t exist on your host). Exclude core files from the backup.

The backup should use cpio format and an online index should be kept. If this step were to fail, the backup job should continue to the next step.

  1. Select backup3G configuration > Maintain backup jobs > Items > Maintain then select Maintain > Add.
  2. Accept the default item number.
  3. Type in the directory name: /usr/home
  4. Select the name of your host machine. You can press Choose to see the list of all the available hosts at your site.
  5. Press Choose to display the valid backup methods. Move the pointer next to full cpio and scroll right a few times. You will see that the Index column for ‘full cpio’ says ‘yes’. Choose full cpio.
  6. Set Index to ‘yes’.
  7. Enter in the Options field: -x “ */core”
  8. Now enter a comment, such as “Full backup of users home directories”
  9. Set On error to ‘continue’.
  10. Press Accept to add this item.

You can now select this item when defining a step in a backup job (see How to Define a Backup Job on page 78).


Example: multi-part backup step

Task: /usr/home is growing and may soon exceed the capacity of a single tape. Change the item defined above to allow for /usr/home to be written to multiple volumes if necessary.

  1. Select backup3G configuration > Maintain backup jobs, then Items > Maintain.
  2. Choose the item you defined in the previous example (/usr/home, ‘full cpio’), then select Maintain > Change.
  3. Move the cursor to the Method field and press Choose. Select “full cpio - MP”
  4. Press Accept to save the changed item details.

Any backup job that uses this item will now write to more than one volume if necessary.


How to Define a Backup Job

This topic tells you how to define all the information required to run a backup job:

scheduling
how and when the job is initiated, when it will run, and whether to auto-acknowledge it.
output
the drive and media type, whether this backup should be appended to an existing tape, how long the backup should be

retained, and what location it should be sent to.

backup steps
which items will be backed up, plus any extra commands that must be run at the start or end of the job.

Backup3G’s scheduling features will be sufficient for most backups. If complex scheduling and inter-task dependencies are required, we recommend you use backup3G’s companion product duty3G.


To Define Information About a Backup Job

  1. Select Maintain backup jobs from the backup3G configuration menu. A list of existing backup jobs is displayed.
  2. Select Jobs > Add to display the prompt form.
    Job
    Enter a unique and representative name.
    Description
    Appears in the duty schedule, so make it meaningful to help users to choose the right backup job.
    Mode
    Select the default method for running this job:
    scheduled - if the job will run to a regular schedule and requires some operator action (such as loading a tape)
    automatic - if it will be run as an automatic duty (that is, at a set time without user intervention)
    request - if there is no regular schedule—the job will be run as required.
    Auto-acknowledge
    You may wish to avoid operators having to manually acknowledge completion of the job. The options are:
    onsuccess - automatically acknowledge this job if it finishes successfully (return status 0). This is the default.
    never - an operator must always manually acknowledge this job whatever its return status.
    always - always automatically acknowledge this job. If you choose this, you must use some other way to warn if this backup fails, such as an At-end command that sends mail to an administrator when the job returns a non-zero exit status.


When to initiate the job (scheduled or automatic backup)

The When and Run Time(s) fields determine when a scheduled or automatic backup job will be initiated.

Automatic backups start running as soon as they are initiated. Scheduled backups appear on the operator’s list of outstanding backups for the period specified in Run Time(s), and start running at the time you specify in the Day and Time fields.

When
Select the day(s) on which the job is to be run.
Run Time(s)
automatic backup: enter the time of day when the backup should run. Examples:
08:00        start the job at 8 am
08,11:00   start the job at 8 am and 11 am
08-10:30   start the job at 8.30 am, 9.30 am, and 10.30 am
scheduled backup: enter the time period during which the job should be initiated by an operator. Examples:
<blank>        all day
08:00-14:30   between 8 am and 2.30 pm
-08:00            from midnight to 8 am
08:00-            from 8 am to midnight
If not done?
(scheduled backups only) select what action to take if the job has not been started by the end of the scheduled time:
abandon - remove the job from the list of outstanding backups. It will not reappear until the next time the backup is scheduled.
outstanding - leave the job on the list of outstanding backups. It will stay outstanding until it is performed.

The next three fields specify the drive that will write the backup; how long the backup will be kept; and if it will be stored offsite, the location.

Drive/Pool
Choose the name of a drive or drive pool.
Retention
Select a retention period. The tape or disk will be released for reuse after this time.
To add a new retention period, see How to Define a Retention Period on page 88.
Store offsite
You have the option of moving this backup to another media location. Select a location or leave blank.
To add a new location, see Adding a New Media Location on page 116.


At-start, at-end, and at-unload commands

You can tell backup3G to run a command at the start or end of the job, or when the volume is unloaded from the drive. Press Backup cmd(s) to enter one or more of these commands.

Figure 14 — Defining commands to be run with the backup job

The At-start cmd runs before the first backup step. Example: bring down a database before backing it up.

The At-end cmd runs after the last backup step, just before the job ends. Example: if any step returned a non-zero exit status ($maxstatus != 0) mail details of the backup to the senior operator.

The At-unload cmd runs when the job is acknowledged. Example: printing the catalog for this media set (see Figure 30 on page 114 for a sample.) This aids data recovery when backup3G itself is unavailable.

Commands that are common to several jobs, or that need to be performed in the middle of the job, can be defined as non-backup items and then selected as required at the end of this process.


When to run the job (scheduled backup)

Scheduled backups may be initiated hours or days before they are due to run. For example, on Friday afternoon operators may submit scheduled backups to run on Saturday night. In the When and Run Time(s) fields you specified when this backup should be initiated. Now you will enter the Day and Time when the job should start.

Figure 15 — Run day and time for a scheduled backup
Day
Select a day of the week, or select ‘Next 24hrs’ to have the job run within 24 hours from when it is scheduled.
Time
Enter the time (in the format HH:MM, 24 hour clock) when the job should start.
Append to
You can write this backup to the end of an existing media set. Choose the name of the backup job you want to append to. To always write to a new media set, leave this field blank.
Appending backup strategies are discussed in Appending Backups onpage 36.

Press Accept to finish defining the job and scheduling details.


To Define the Steps in a Backup Job

The next task is to select the items to be backed up by this job. Each item comprises a filesystem or directory and the method that will be used to back it up.

At this point backup3G display the list of predefined items.

Figure 16 — Choosing the steps for a backup job

Note - Some directories may appear more than once, for example if two different backup methods may be used. You can use Search to find all the items for the directory you want.

Select the items that you want to include as steps in your job. In GUI mode, click an item to select it, Ctrl-click to add a row to the selection, and Shift-click to add several consecutive rows to the selection. In CUI mode, press the Select button to add a row to the selection, or press Select over a highlighted row to remove it from the selection.

If an item you want doesn’t appear in the list, you can add it: see How to Define a Backup Item on page 74.

Press Accept to create a backup step for each of the selected items.



To Maintain the Steps in a Backup Job

You can add, remove, or reorder the steps performed by a backup.

  1. From the backup3G configuration menu, select Maintain backup jobs.
  2. Select the backup job, then select Jobs > Steps to display the steps currently assigned to that job.

Figure 17 — Maintain backup steps window


To add steps to a job

  1. From the ‘Maintain steps’ screen, select Maintain > Add.
  2. Select one or more items.

Press Accept to add the steps to the end of the backup job.


To append steps from another job

If your new job is similar to an existing backup, it may be quicker to append the steps from the older backup.

  1. From the ‘Maintain steps’ screen, select Maintain > Append.
  2. From the list of jobs displayed, select the job from which you wish to copy steps.
  3. Select Accept to have all of the steps from the chosen job added to the end of your current list.
  4. Delete unwanted steps by selecting them and using the Maintain > Remove option.


To change the order in which the steps will be run

  1. From the ‘Maintain steps’ screen, select Maintain > Reorder.
  2. Drag and drop the steps into the order required.

Press Accept to save the changes and return to ‘Maintain steps’.


To Set Up a Duty for a Backup Job

This section applies only to sites with duty3G installed. When the definition of a backup job and all of its steps is complete, the job can be set up as a duty as follows:

  1. Select backup3G configuration > Maintain backup jobs.
  2. Select the job you wish to create a duty for.
  3. Select Jobs > Duty.
    The addition of the duty will be confirmed. The relevant fields are filled with values from the backup job. If there are any inconsistencies or errors, duty3G will be started so you can make the necessary alterations.
  4. Run duty3G to verify that the duty has been created. Make any changes to the name or to the scheduled run time as required using duty3G Administration options as described in the duty3G User Guide.


Example: Define a Backup Job

Task: define a job to do a full cpio backup of /usr/home and /usr/COSmanager to a new media set every Friday at 11.00 p.m. The backup should be scheduled some time between noon and 5.00 pm on Friday afternoon. Retain each backup for one week. Print the media contents and mail a message when the job is finished.

Note - In the following example, backup items must already exist for /usr/home and /usr/COSmanager. See To define a backup item on page 74. for details of how to add items. Use other directory names if your home and COSmanager directories are in a different location.

  1. Select Maintain backup jobs from the backup3G configuration menu. A list of existing backup jobs is displayed.
  2. Select Jobs > Add to display the prompt form. Job Enter job name ‘test_usr’.

Description Enter a description that will help the user to identify this job. Mode Press Select until the mode is set to ‘scheduled’. Auto-acknowledge Leave at the default setting of ‘onsuccess’. When Choose ‘Weekly - Friday’. Run Time(s) Enter 12:00-17:00 to have the job appear on the operators’ ‘outstanding backups’ console at noon. Running the job will involve the operator loading the requested tape into the drive in preparation for the 11 p.m. execution of backup. If not done? select ‘outstanding’ to keep the job on the console until it is scheduled. Drive/Pool Press Choose to see the list of valid drive/pool names. Select a drive and press Accept. Retention Select one week. Store offsite As this backup won’t be stored offsite, press Enter or the down arrow key to skip over this field. Press Backup cmd(s). At-start cmd Skip this field. At-end cmd Enter “mailx -s “incremental backup of /usr/home and /usr/COSmanager: status $maxstatus” < /dev/null“. At-unload cmd Enter “( banner $Set_ID; medprint $Set_ID )”. Press Return to return to the main ‘Add Backup Job’ window. Day Select ‘Friday’. Time Enter 23:00 to have the job start at 11 p.m. Append to As you want to write each backup to a new media set, leave this field blank.

Press Accept to save the job. The list of predefined backup items is then displayed automatically.

  1. Press the Search key and enter /usr/home or just scroll to that item.

Move the cursor to the row for ‘full cpio of /usr/home directory’ and select that line. It doesn’t matter for this example whether the Index column says ‘yes’ or ‘no’.

  1. Now add /usr/COSmanager to your selection by middle-clicking or by using the Select function. Press Accept to save the selection and return to the ‘Maintain backup jobs’ window.

If you miss a step or want to change an item after returning to the ‘Maintain backup jobs’ window, simply select the job again and use Jobs > Steps, then Maintain > Add to redisplay the choose list of items. This backup will now appear on the console as an outstanding job on the following Friday. It can also be run at other times; See Initiating and Managing Backups on page 89.


How to Define a Retention Period

Backups are retained for a set period. At midnight on the expiry date, the media set is released. The backup data is not physically erased, but the tape or disk becomes available to be selected by another job. Example: a media set with an expiry date of 30 June cannot be re-selected until 1 July.

The retention period is specified in the backup job.

There is a special retention period, ‘forever’. This sets the expiry date to null, meaning that the volume never expires. You can also add your own retention periods.


To define a retention period

  1. Select backup3G configuration > Maintain tables.
  2. Select the ‘Retention Periods’ table, then select Table > Maintain.
  3. Select Maintain > Add.
    Retention
    Enter a name. Example: ‘pay month’.
    Days
    Enter the period in whole days. Example: ‘28’.
    Comment
    Enter a description. Example: ‘retain for four weeks’.
  4. Press Accept to save these details.

You can now select this period when you next define a backup job.