NBU 5.1: Manually starting a backup policy from a script? - Veritas Net Backup

This is a discussion on NBU 5.1: Manually starting a backup policy from a script? - Veritas Net Backup ; Hello! Is it somehow possible, to start a backup policy from within a shell script on Unix? What I'd like to do: 1) Do some "setup" of the backup directory. That's done by some script. 2) Start backup. 3) After ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: NBU 5.1: Manually starting a backup policy from a script?

  1. NBU 5.1: Manually starting a backup policy from a script?

    Hello!

    Is it somehow possible, to start a backup policy from within
    a shell script on Unix?

    What I'd like to do:

    1) Do some "setup" of the backup directory. That's done by some script.
    2) Start backup.
    3) After the *COMPLETE* backup finishes, do some cleanup.

    How would I implement step 2)?

    Alexander Skwar

  2. Re: NBU 5.1: Manually starting a backup policy from a script?

    Alexander Skwar :

    > Is it somehow possible, to start a backup policy from within
    > a shell script on Unix?


    Hm, /usr/openv/netbackup/bin/bpbackup seems to be the correct
    tool for this. After having created a schedule of type "User
    Backup", I can use this command to initiate backups from the
    client.

    Fine.

    Are those backups always full backups? Or can I somehow specify,
    that I want a Differential Incremental Backup now?

    Cheers,

    Alexander Skwar

  3. Re: NBU 5.1: Manually starting a backup policy from a script?


    It will always a FULLbackup If you are running under user schedule otherwise
    you can use -s switch with bpbackup to tell what schedule should be used.

    Check man page for bpbackup.
    ---
    NAME
    bpbackup - Back up files to the NetBackup server.

    SYNOPSIS
    /usr/openv/netbackup/bin/bpbackup [-p policy] [-s schedule]
    [-S master_server [,master_server,...]] [-t
    policy_type] [-L progress_log [-en]] [-w [hh:mm:ss]]
    [-help] [-k "keyword_phrase"] -f listfile | filenames

    /usr/openv/netbackup/bin/bpbackup -i [-p policy] [-h host-
    name] [-s schedule] [-S master_server
    [,master_server,...]] [-t policy_type] [-L progress_log
    [-en]] [-w [hh:mm:ss]] [-k "keyword_phrase"]

    /usr/openv/netbackup/bin/bpbackup -dssu storage unit name

    DESCRIPTION
    bpbackup starts either of the following processes:

    On clients

    Using the first form of the command above, bpbackup starts a
    user backup that is the equivalent to what is performed by
    using the interface on the client. This type of backup can
    be started from any NetBackup client in order to back up
    files from that client.

    The bpbackup command processes the files that you list on
    the command line or in the file that you specify with the -f
    listfile option. A file path can be a file or directory
    name. If the named files include a directory, bpbackup backs
    up all files and subdirectories of that directory starting
    at the directory itself.

    -Rk

    Alexander Skwar wrote:
    >Alexander Skwar :
    >
    >> Is it somehow possible, to start a backup policy from within
    >> a shell script on Unix?

    >
    >Hm, /usr/openv/netbackup/bin/bpbackup seems to be the correct
    >tool for this. After having created a schedule of type "User
    >Backup", I can use this command to initiate backups from the
    >client.
    >
    >Fine.
    >
    >Are those backups always full backups? Or can I somehow specify,
    >that I want a Differential Incremental Backup now?
    >
    >Cheers,
    >
    >Alexander Skwar



  4. Re: NBU 5.1: Manually starting a backup policy from a script?

    Hi Alex,
    User mode backups are always full, and cannot be incremental or
    differential.
    Alternatively, I believe the bpbackup command can be used to trigger a
    policy and schedule name on a master server.
    You could try coding your scripts so that one part of the mechanism is on
    the master server (possibly watching for a flag file on the client) and then
    fire of the backup of a policy and an incremental schedule on the master
    server.
    I think you have to use
    bpbackup -i
    to start a policy immediately.
    Regards,
    Dave.


    "Alexander Skwar" wrote in message
    newsfmygjcl7cy7$.dlg@std.dialog.schweiz.digitalproject s.com...
    > Alexander Skwar :
    >
    >> Is it somehow possible, to start a backup policy from within
    >> a shell script on Unix?

    >
    > Hm, /usr/openv/netbackup/bin/bpbackup seems to be the correct
    > tool for this. After having created a schedule of type "User
    > Backup", I can use this command to initiate backups from the
    > client.
    >
    > Fine.
    >
    > Are those backups always full backups? Or can I somehow specify,
    > that I want a Differential Incremental Backup now?
    >
    > Cheers,
    >
    > Alexander Skwar




  5. Re: NBU 5.1: Manually starting a backup policy from a script?

    RK :

    > It will always a FULLbackup


    Darn That really sucks.

    > If you are running under user schedule otherwise
    > you can use -s switch with bpbackup to tell what schedule should be used.


    No, you cannot, as you need to specify a schedule of type "User Backup".
    Check the documentation

    You're of course right, that you can use a -s switch, but
    I don't understand what's the use of this switch (yes, I
    know, it's for giving the schedule). It seems to be a
    quite awkward way of setting the Storage Unit or Volume
    Pool. But that's just me, I guess.

    > Check man page for bpbackup.


    I did, and that's why I asked, as the documentation doesn't
    say anything reg. the type of backup that's done.


    Alexander Skwar

  6. Re: NBU 5.1: Manually starting a backup policy from a script?

    D R :

    > Hi Alex,
    > User mode backups are always full, and cannot be incremental or
    > differential.


    Buggers. Has this been changed in 6.0?

    > Alternatively, I believe the bpbackup command can be used to trigger a
    > policy and schedule name on a master server.


    Not in a useful way. You can specify a schedule, but that schedule
    must be of type User Backup.

    | -s schedule
    | Names the schedule to use for the backup. If it is not specified, the
    | NetBackup server uses the first user backup schedule it finds for the
    | client in the policy it is using (see the -p option).

    And if you specify a schedule of a different type with "-s",
    the backup will fail with status 240: "no schedules of the
    correct type exist in this policy".

    > You could try coding your scripts so that one part of the mechanism is on
    > the master server (possibly watching for a flag file on the client) and then
    > fire of the backup of a policy and an incremental schedule on the master
    > server.


    Hm, not exactly pretty, but I guess that's a route that I'll
    have a closer look at.

    > I think you have to use
    > bpbackup -i
    > to start a policy immediately.


    Thanks a lot!


    Alexander Skwar

  7. Re: NBU 5.1: Manually starting a backup policy from a script?

    Hi Alex,

    Here's a copy of my notes regarding requesting "user mode" backups from
    client site:



    bpbackup Windows DOS batch example:



    $ set z_nbu=C:\test.nbu

    $ set z_log=C:\test.log

    $ bpbackup -p ADMIN-CONSOLES -h %computername% -s DAILY_USER -t 13 -L
    "%z_log%" -w -f "%z_nbu%"





    Example list of files "C:\test.nbu". File can be in a folder if you want.
    Note the use of a leading number to describe how long the path specification
    is:



    7 C:\TEST

    9 D:\TEST 2

    3 E:\

    5 F:\ZZ







    bpbackup

    -p policy-name Defines storage unit, and thus media server to
    use, and also volume pool.

    -h client-name If left blank, it will run the policy for all
    clients defined within the policy.

    -s schedule-name This controls retention level (and optionally
    override storage unit and volume pool)

    -t policy-type (13 = Windows, 0 = standard Unix and/or
    OpenVMS)

    -L log-file Progress log file

    -w hh:mm:ss Time to wait for completion.





    Notes:

    The log file is appended to. If a fresh log file is required for each run,
    then delete it (or rename it out of the way) before requesting a backup.
    The log file and "file list" file (i.e. "test.nbu") must exist on a local
    drive visible to the "system/administrator" account. Do not use mapped
    drives, as this causes error 12 (file read failure) and also causes backup
    jobs to hang.







    Other Switch examples:

    -w without a parameter, is the same as -w 0

    -w 0 wait indefinitely

    -w hh:mm:ss maximum wait is 23:59:59

    (if the time expires, then the backup continues being saved to the media
    server, i.e. it is NOT terminated/aborted, but the local "bpbackup" command
    does exit with a timeout status code.)









    I still think you can fire off normal full, incremental and differential
    policies/schedules, but only from an administrative session on a master
    server, using bpbackup -i.



    HTH.



    Regards,

    Dave.







    "Alexander Skwar" wrote in message
    news:1w4mauuyzfc8w$.dlg@std.dialog.schweiz.digital projects.com...
    >D R :
    >
    >> Hi Alex,
    >> User mode backups are always full, and cannot be incremental or
    >> differential.

    >
    > Buggers. Has this been changed in 6.0?
    >
    >> Alternatively, I believe the bpbackup command can be used to trigger a
    >> policy and schedule name on a master server.

    >
    > Not in a useful way. You can specify a schedule, but that schedule
    > must be of type User Backup.
    >
    > | -s schedule
    > | Names the schedule to use for the backup. If it is not specified, the
    > | NetBackup server uses the first user backup schedule it finds for the
    > | client in the policy it is using (see the -p option).
    >
    > And if you specify a schedule of a different type with "-s",
    > the backup will fail with status 240: "no schedules of the
    > correct type exist in this policy".
    >
    >> You could try coding your scripts so that one part of the mechanism is on
    >> the master server (possibly watching for a flag file on the client) and
    >> then
    >> fire of the backup of a policy and an incremental schedule on the master
    >> server.

    >
    > Hm, not exactly pretty, but I guess that's a route that I'll
    > have a closer look at.
    >
    >> I think you have to use
    >> bpbackup -i
    >> to start a policy immediately.

    >
    > Thanks a lot!
    >
    >
    > Alexander Skwar




+ Reply to Thread