cancel
Showing results for 
Search instead for 
Did you mean: 

Backing up OpsCenter

J_H_Is_gone
Level 6
Wondering if I am just missing something.

In NOM you had Cycle Settings - which means INSIDE NOM you set up backups to disk.
I had it set to backup to disk 5 days a week.
Then the normal backup of the server would get that disk backing onto tape.

in OpsCenter - I cannot find anything like Cycle Settings.
And the only thing I can find in the manual is the dbbackup.bat script.

Now this has me thinking I have to setup a bpstart_notify.bat file with the command to backup to disk.(making sure my time out is long enough for it to finish)  then let the NB policy get it to tape.

So......

Am I missing something simple,....how are the rest of you doing your OpsCenter backups?
1 ACCEPTED SOLUTION

Accepted Solutions

Kevin_Good
Level 5
Certified
bpstart_notify.bat...

The other thing you could do, is just set up the windows scheduler to run the dbbackup.bat, since you're not concerned with the detail data (just the configuration data) as OpsCenter will poll the delta from NBU itself.

View solution in original post

3 REPLIES 3

Kevin_Good
Level 5
Certified
bpstart_notify.bat...

The other thing you could do, is just set up the windows scheduler to run the dbbackup.bat, since you're not concerned with the detail data (just the configuration data) as OpsCenter will poll the delta from NBU itself.

J_H_Is_gone
Level 6
ended up going the task path - with it outputting the backup info to a file.
then a second action to email me that file, so I can verify that the backup to disk WORKED.
Just hated the idea that it backups and not sure if it worked.... could fail and I would never know it.
Now I get an email I can check to make sure it backups to disk ok.

J_H_Is_gone
Level 6

With grateful help from my windows admins I think I got it!  (if it would run on AIX I would have had this done faster and easier with cron and a script)

first I made a couple of changes to the dbbackup.bat file.

Added at the beginning and the end.

date /t
time /t

Added to the if section where it checks for return code of the actually backup  A line to make and event ID that goes to windows Application event log


if %ERRORLEVEL% NEQ 0 (
 echo ERROR backing up the %PRODUCT_NAME% Database, Exiting...
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org" copy "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org" "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org" copy "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org" "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org"
        eventcreate /l application /so "NetBackup INET Daemon" /t error /id 69 /d "myservername backup to disk failure."
) else (
 echo %PRODUCT_NAME% Database backup successful.
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.db.org"
 if exist "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org" del "%BACKUP_DIR%\%OPSCENTER_DB_DATAFILE_NAME%.log.org"
)

NOTE: made a copy of the dbbackup.bat in case any upgrade overwrites it.  I just have to remember to check it after upgrades.

I want to keep one week of backups on disk on the server
So I made a backup dir
inside I made a dir for each day of the week.

Now I went to the windows Task Scheduler.
I made a task to run that dbbackup.bat script

General Tab:
change the user to be <domain>\ourjobrunningaccount
run weather user is logged on or not
Run with highest privileges
Configured for windows R2
Name is Friday Backup  (made one for each day of the week)

Triggers Tab:
Begin task On a Schedule
Set to run once a week on Friday at 10:00 am (this is a quite time for NB so thought it would be a good time to get the OpsCenter backup done).  It will go to tape that night when the normal system backup runs.
Enabled
Stop if runs longer then 4 hours

Actions Tab:
Action :Start a program
full path to the dbbackup.bat script
Add arguments   E:\Backup\Friday > E:\Backup\Friday\task.log
    (So the Friday task puts the backups in the Friday dir.  and all output from the script will go into the task.log file for that day as well.  Remember the date and time I added to the script.  That will show up here in the task.log so if I want to see times or if it fails I can see all the output from the bat file here in the same dir as the backup was going)

Conditions tab:
Really up to you I have only start if the system is on, or start when it switches to battery so I can get a quick backup before it dies.

Settings:
Allow on demand
Run as soon as possible if it miss' a schedule ( could be due to system work)
Stop if it runs longer then 4 hours.  (here is where I will be watching how long it runs in that task.log as I start it.  As time goes buy it will run longer and longer and I really want to see just how long it takes)

=============

Now I create a task to monitor for the failure
General tab:
Name: Email Alert Backup Failure
again set to be run by our job account
Run even if not logged in
Set to Win R2

Triggers:
Begin task : On an event  (this causes it to watch all the time for that event entry)
Settings: Custom
Edit event filter: XML

<QueryList>

<Query Id="0" Path="Application">

<Select Path="Application">*[System[Provider[@Name='NetBackup INET Daemon'] and (Level=2) and (EventID=69)]]</Select>

</Query>

</QueryList>

Enabled

Actions Tab:
Action: Send Email
From: <someone>@yourdomain.com
To: <someonewhocares>@yourdomain.com
Subject: OpsCenter -  backup to disk failure
Text: whatever you want.
SMTP:  your mail server

Conditions Tab:
nothing

Settings Tab:
Allow on demand
Stop if longer then 1 hours

======================================================================
My test was to make the event entry and I did get the email.


Disclaimer:  I am not a windows admin.  I had lots of help figuring this out ( and now know more about windows then I wanted to).  Anybody who wants to use this idea, This is my outline.  verify and test at your own risk.