cancel
Showing results for 
Search instead for 
Did you mean: 

OpsCenter database backup

Amaan
Level 6

Hi All,

Is there way to automate OpsCenter database backup. i know that backup can be done by running dbbackup and destination, but it should be run manully, how i can automate that, so it will run everyday according to schedule (with windows task scheduler)

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Ramazan_Cakir
Level 3

Trying to automate dbbackup with windows schedule did not work first.

But here is what i have done :

- copy dbbackup.bat to <your_db_backup.bat> in C:\installpath\bin\

(script has to reside in his origin directory)

- modify in <your_db_backup.bat> following lines :

.....

@REM if "%~1" == "" goto HELP <-- origin line
if "%~1" == "" goto MAIN     <-- modification
goto MAIN

......

:MAIN
@REM set BACKUP_DIR=%~1   <-- origin line
set BACKUP_DIR="H:\backup"   <-- modification

- create a schedule where in tab TASK :

RUN --> "C:\Program Files\Symantec\OpsCenter\server\bin\<your_db_backup.bat>"

START IN --> "C:\Program Files\Symantec\OpsCenter\server\bin"

- and modify in schedule tab time settings for your need

hth

 

 

 

View solution in original post

7 REPLIES 7

Ramazan_Cakir
Level 3

Trying to automate dbbackup with windows schedule did not work first.

But here is what i have done :

- copy dbbackup.bat to <your_db_backup.bat> in C:\installpath\bin\

(script has to reside in his origin directory)

- modify in <your_db_backup.bat> following lines :

.....

@REM if "%~1" == "" goto HELP <-- origin line
if "%~1" == "" goto MAIN     <-- modification
goto MAIN

......

:MAIN
@REM set BACKUP_DIR=%~1   <-- origin line
set BACKUP_DIR="H:\backup"   <-- modification

- create a schedule where in tab TASK :

RUN --> "C:\Program Files\Symantec\OpsCenter\server\bin\<your_db_backup.bat>"

START IN --> "C:\Program Files\Symantec\OpsCenter\server\bin"

- and modify in schedule tab time settings for your need

hth

 

 

 

Amaan
Level 6

Hi Thanks for your response. The changes which I made for the script worked fine. i tried to run it manually and it was successful.

But when i tried to schedule and run the script from task scheduler it is failing. What can be wrong?

Amaan
Level 6

Please find attached error.

RonCaplinger
Level 6

Just add a task in Windows Scheduler with full path info, no need to edit the script. 

  1. You will need to create a local account/password on that server so the script can be run by that ID.  Google "windows 2003 create user account" to see how to do this.
  2. Ensure the user ID you created works by logging into the box with that ID and password.  if you can't get logged in, you need to troubleshoot why the ID won't work.
  3. Create a new Scheduled Task in Windows Control Panel with the following setup:
  • RUN: "<NBU install path>\OpsCenter\server\bin\dbbackup.bat"  <path to store the backup file>
  • Start In: "<NBU install path>\OpsCenter\server\bin"
  • Run as:<server name>\<ID you created above>
  • Click on "Set Password" and enter the password you created above

Amaan
Level 6

Hi Guys,

Thanks again. Actually I tried both of the ways. We have two opscenter servers and actually for one of them i did below:

I have changed the script as Ramazan Cakir said and create schedule as per him. first i was getting error, but i changed this:
 

START IN --> "C:\Program Files\Symantec\OpsCenter\server\bin" - original as Ramazan said;

START IN --> C:\Program Files\Symantec\OpsCenter\server\bin - modified.

Wondering why it didnt work with "", and worked without them.

 

ANd in the other server i have tried as RonCaplinger said, but in addition i have added ARGUMENT field the directory (destination), so i did as below:

  • RUN: "<NBU install path>\OpsCenter\server\bin\dbbackup.bat"  <path to store the backup file>
  • Argument: D:\DBBackup
  • Start In: "<NBU install path>\OpsCenter\server\bin"

and i didnt create seperate user, as i had admin rights in the system. both way wroked fine. and working fine.

Thank you guys. Please let me know your thoughts on what i did.

 

Ramazan_Cakir
Level 3

Please find attached screenshot how schedule task is defined. I made the modification in script due failures with giving backup destination as a parameter.

Sorry forgot to say that i have windows 2003 R2 / x64 ; could be a difference. Further i had to define a new user due internal reasons which has admin rights.

One good thing to Ron's solution is that this script will always be available and my script might get overwritten due upgrad / installation of new version of OpsCenter.

Cheers

Amaan
Level 6

Thanks you all. My issue has been resolved with your help.