Forum Discussion

mrinal_sarkar62's avatar
14 years ago

Scheduling backup to start after one completes.

Hi,

I have 2 backup policy - one is for windows(64bit) and other is for RHEL5(32bit).

I have one tape librery with one drive.

My Master server is NBU 7.0 on Solaris 10(64bit).

My question is :-

Is it possible to start the windows backup after the complatation of Linux backup autometically , without providing time.

As the data is very much changing in both the server.

Thanks.

  • if [ $2 = "NAME OF WINDOWS POLICY" ]

    then

    OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED.<NAMEOFWINDOWS POLICY>

    if [ -s $OUTF ]

    then

    /bin/rm -rf $OUTF

    fi

    if [ ! -f $OUTF ]

    then

    touch $OUTF

    fi

    echo ${dateStr} "-----------------------------" >> $OUTF

    echo ${dateStr} " CLIENT: $1" >> $OUTF

    echo ${dateStr} " POLICY: $2" >> $OUTF

    echo ${dateStr} " SCHEDULE: $3" >> $OUTF

    echo ${dateStr} "SCHEDULE TYPE: $4" >> $OUTF

    echo ${dateStr} " STATUS: $5" >> $OUTF

    echo ${dateStr} " STREAM: $6" >> $OUTF

    echo ${dateStr} " STREAM_CNT: $7" >> $OUTF

    echo ${dateStr} "-----------------------------" >> $OUTF

    /<installpath>/openv/netbackup/bin/bpbackup -p <NAME OF LINUX POLICY> -s <NAME OF SCHEDULE TO RUN> -h <NAME OF LINUX CLIENT> -S <MASTERSERVER> -t 0  >> $OUTF

     

    this is just an exmaple and you should test for your enviroment.

    if you have a different schedule for fulls on the weekend they you will need to add if statments to test if it is a day you want to run a full then use a different schedule name.

    all the info will be in the  OUTF file defined.  you can look at that or even email it to you if youwant.

    make the changes of putiting in the correct info for your enviroment.

10 Replies

  • Yes it is possible .

    You can configured backup policy and schedule as per your requirment

  • Anonymous's avatar
    Anonymous

    I recommend you use the backup exit notify scripts.

    On the master server look at

    /usr/openv/netbackup/bin/backup_exit_notify

     

    Say you have 2 policies

    CLIENT-SOL-DAILY

    CLIENT-WIN-DAILY

    The notify script looks for 6 parameters to be passed through it. One of them the policy name.

    You could configure/modify it like the following:

    TYPE=`echo $POLICY | awk -F"-" '{print $2}'`

    #get the second field of the policy name

    echo `date` "         TYPE:  $TYPE" >> $OUTF
    echo `date` "-----------------------------" >> $OUTF

    if [ $TYPE = "SOL" ]; then
            export CLIENT POLICY SCHEDULE SCHEDULE_TYPE STATUS STREAM
            /usr/openv/netbackup/bin/bpbackup -i -p CLIENT-WIN-DAILY
    fi

     

    Policy CLIENT-WIN-DAILY would have no backup scheduled time but backup window 24/7 as it is only kicked off after a successful SOL backup.

  • As I read your'e question you want first to backup Linux boxes and when those are done you wan't that policy to kick off the Windows backup.

    In short words, it not possible out of the box.

    Secondly why do you want to do this ? There is nothing wrong in starting backup of both OS'es at the same time. A lot of effort has been made in Netbackup to maximize backup execution.

    If you want Window and Linux data on different tapes, then create two volume pools and point each policy to associated volume pool.

  • As Nicolai says NB can take care of that for you.

    If you just want one to run at a time... then set your storage unit Max drives of 1 and Multiplexing to 1, then only one job will go to the tape at a time.

    But there is no problem putting both to the same tape at the same time (multiplexing 2)

    You want two different tapes, then one windows pool and that policy uses tape in it, and one Linux pool and that policy's uses tapes in it.  One job will go and wait for the tape to unmount before the other one.  It is OK if both jobs start, the second one will just queue up and wait.

    Now if you have some other reason, I would use the parent_end_notify script on the master.

    Put in an if statement that says if the policy was windows then ..... and use the bpbackup command to start the Linux backup.

     

    the parent_end_notify on the master waits for the parent job to finish, where backup_exit_notify runs when any child finishes.  So if you have a parent and 2 child process as soon as the frist child finishes it would start the Linux job, where it sounds like you would like the whole windows backup to finish before Linux starts, it would be best for the parent_end in that case.

  • Hi,

    Ok I'll try the script in a test enviourmnt and if its successful I will put it in production.

    But, what if the 1st backup fails. As I can asume the 2nd backup starts only when the 1st backup is successful.

    Nicolai :- I did'nt get you , why it is not possible any specific reason, please do update.

    Yes, there alternative way I thought about , is that If I start the both the backup in a hour difference then one will ececute and the other will be in que. But the 2nd backup job  may fails if the 1st backup takes long time.

    Thanks.

  • It does not mater if the first one fails or not.

    The parent_end_notify and the backup_end_notify both run when the job finishe no matter what the status is.

    Now you could write the script to look at the status and test if it failed, but that is not needed in your case.  When the job is done the script will run, and if you have setup your if statement correctly it will start the next job.

     

    here is an example of what I have my parent_end_notify do. (unix)

    It only tests for the name of the policy $2 - where you could test for $1 or $2

     

    if [ $2 = "Hot_Catalog_Backup" ]

    then

    OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED.Hot_Catalog_Backup

    if [ -s $OUTF ]

    then

    /bin/rm -rf $OUTF

    fi

    if [ ! -f $OUTF ]

    then

    touch $OUTF

    fi

    echo ${dateStr} "-----------------------------" >> $OUTF

    echo ${dateStr} " CLIENT: $1" >> $OUTF

    echo ${dateStr} " POLICY: $2" >> $OUTF

    echo ${dateStr} " SCHEDULE: $3" >> $OUTF

    echo ${dateStr} "SCHEDULE TYPE: $4" >> $OUTF

    echo ${dateStr} " STATUS: $5" >> $OUTF

    echo ${dateStr} " STREAM: $6" >> $OUTF

    echo ${dateStr} " STREAM_CNT: $7" >> $OUTF

    echo ${dateStr} "-----------------------------" >> $OUTF

    /usr/sbin/rdist -f /usr/sysadmin/scripts/Data/Rdist_Dist_Netbackup_DR >> $OUTF

    cat $OUTF | mail -s "NetBackup parent end notify for Catalog" someonewhocares@mydomin.com

    fi 

  • Hi,

    I am not a champ in script and using them.

    May I have any idea how to use the script and get output from that.

    Thanks

  • Anonymous's avatar
    Anonymous

    Administrator's Guide for UNIX,Linux, II  http://www.symantec.com/docs/TECH127080

    It discusses the parameters and all notify scripts to help you. (Section 3. reference topics)

    I am no script champ either but can just understand whats going on - your not alone.

    It should all be clear if this is what you need to perform what you want.

    Hopefully someone in your team is better at the scripting, ask for there help.

     

    Output from the scripts will be referenced with this variable in the scripts

    OUTF = the output filename and path to capture parts of the script executing; where it is referenced.

  • if [ $2 = "NAME OF WINDOWS POLICY" ]

    then

    OUTF=/usr/openv/netbackup/bin/PARENT_END_CALLED.<NAMEOFWINDOWS POLICY>

    if [ -s $OUTF ]

    then

    /bin/rm -rf $OUTF

    fi

    if [ ! -f $OUTF ]

    then

    touch $OUTF

    fi

    echo ${dateStr} "-----------------------------" >> $OUTF

    echo ${dateStr} " CLIENT: $1" >> $OUTF

    echo ${dateStr} " POLICY: $2" >> $OUTF

    echo ${dateStr} " SCHEDULE: $3" >> $OUTF

    echo ${dateStr} "SCHEDULE TYPE: $4" >> $OUTF

    echo ${dateStr} " STATUS: $5" >> $OUTF

    echo ${dateStr} " STREAM: $6" >> $OUTF

    echo ${dateStr} " STREAM_CNT: $7" >> $OUTF

    echo ${dateStr} "-----------------------------" >> $OUTF

    /<installpath>/openv/netbackup/bin/bpbackup -p <NAME OF LINUX POLICY> -s <NAME OF SCHEDULE TO RUN> -h <NAME OF LINUX CLIENT> -S <MASTERSERVER> -t 0  >> $OUTF

     

    this is just an exmaple and you should test for your enviroment.

    if you have a different schedule for fulls on the weekend they you will need to add if statments to test if it is a day you want to run a full then use a different schedule name.

    all the info will be in the  OUTF file defined.  you can look at that or even email it to you if youwant.

    make the changes of putiting in the correct info for your enviroment.

  • Hi,

     I am doing the script configration in our test enviourment and will let you guys know the result.

    Nicolai -  I have tried to extent the backup time execution in the backup windows it worked, Thanks for your advice , now I want the script option and we 'll deploy in the test enviourment , which ever we'll find better we will deploy in the production.

    Thanks.