Forum Discussion

AIacono's avatar
AIacono
Level 3
11 years ago

How to use scripts to backup many folders

Hi,

We need to perform a backup using some scripts (like pre post command).

This is our Netbackup Infrastructure:

MasterServer: Windows Server 2008 R2 with Veritas Cluster (NB7.5.0.7)
MediaServer: Linux Redhat & Windows 2008 R2 (NB7.5.0.7)
Client: Linux Redhat (NB7.5.0.7)

We need to perform backup on client following a sequence of script before, during and after backup.

I've a create a standard policy.
On /usr/openv/netbackup/bin I've created a bpstart_notify.<policy_name>.<schedule_name> and bpend_notify.<policy_name>.<schedule_name> but some folders were skipped.

This is the sequence that we need to follow:

  1. Pre-backup script (Set DB with backup mode)
  2. backup of db configuration folder
  3. When first backup is finished a script must be executed (Stop data stream to index)
  4. Wait 30 sec
  5. Backup of data stream folder
  6. When second backup is finished another script must be executed to end backup procedure (Start data stream and unset backup mode on DB)

How can I proceed?

regards,

Amilcare

  • Best to create a script on Linux Client that will do everything in your list, then use crontab to kick off the script.
    Add a User schedule in the policy with open window when user backups will be allowed.
    No need for anything in Backup Selection or start_ or end_notify scripts.

    1. Pre-backup script (Set DB with backup mode)
      (call script or add commands here)
    2. backup of db configuration folder -
      /usr/openv/netbackup/bin/bpbackup <folder-name>
    3. When first backup is finished a script must be executed (Stop data stream to index)
    4. Wait 30 sec 
      sleep 30
    5. Backup of data stream folder
      /usr/openv/netbackup/bin/bpbackup <folder-name>
    6. When second backup is finished another script must be executed to end backup procedure (Start data stream and unset backup mode on DB)
      (call script or add commands here)

     

    PS:
    Any reason why you do not want to or cannot use NBU agents for this DB?

  • -f option needs a filename as argument.
    This file will contain the list of folders/filenames to be backed up.

    If folder list is specified as part of the command, it must be last in the command.

    So, your command need to look like this:

    /usr/openv/netbackup/bin/bpbackup -f /path/filename -p policy_name -s schedule_name 

    or

    /usr/openv/netbackup/bin/bpbackup  -p policy_name -s schedule_name /folder1 /folder2 /folder3  

    See  NetBackup Commands Reference Guide  for command usage.

4 Replies

  • Could you show us your scripts and tell us what was actually skipped so that we can see what is actually not working as you would like it to.

    Also tell us how long all of this takes and what you bpstart / end timeouts are set to (Master and Media Server Host Properties - Timeouts section)

  • Best to create a script on Linux Client that will do everything in your list, then use crontab to kick off the script.
    Add a User schedule in the policy with open window when user backups will be allowed.
    No need for anything in Backup Selection or start_ or end_notify scripts.

    1. Pre-backup script (Set DB with backup mode)
      (call script or add commands here)
    2. backup of db configuration folder -
      /usr/openv/netbackup/bin/bpbackup <folder-name>
    3. When first backup is finished a script must be executed (Stop data stream to index)
    4. Wait 30 sec 
      sleep 30
    5. Backup of data stream folder
      /usr/openv/netbackup/bin/bpbackup <folder-name>
    6. When second backup is finished another script must be executed to end backup procedure (Start data stream and unset backup mode on DB)
      (call script or add commands here)

     

    PS:
    Any reason why you do not want to or cannot use NBU agents for this DB?

  • Hi Marianne.

    First of all, thanks for the reply.

    Any reason why you do not want to or cannot use NBU agents for this DB?

    Regards your question we must use this method because this DB is not Oracle, SQL or DB2. It's a proprietary db of an application.

    I've created a script as you suggested.

    I've used this syntax to launch backup: /usr/openv/netbackup/bin/bpbackup -f "<list_of folders>" -p "<policy_name>" -s "<schedule_name>"

    But job ends with partially successful status because skip some folders.

    I've checked the sequence manually.

    So I've launch the pre-backup script. Then I've modified the backup selection and launched manually full weekly schedule.

    After this first backup I've run the second script and then modified again the backup selection of policy with other folders and run manually full weekly schedule. At the end of this second backup I run the closing script.

    All backups finish with status Successfully completed.

    The policy is a standard type. The schedule type is a user backup.

    Thanks again for your support.

    Amilcare

  • -f option needs a filename as argument.
    This file will contain the list of folders/filenames to be backed up.

    If folder list is specified as part of the command, it must be last in the command.

    So, your command need to look like this:

    /usr/openv/netbackup/bin/bpbackup -f /path/filename -p policy_name -s schedule_name 

    or

    /usr/openv/netbackup/bin/bpbackup  -p policy_name -s schedule_name /folder1 /folder2 /folder3  

    See  NetBackup Commands Reference Guide  for command usage.