06-12-2012 05:05 PM
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!
Solved! Go to Solution.
06-12-2012 11:40 PM
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
06-12-2012 11:40 PM
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
06-13-2012 09:42 AM
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?
06-13-2012 09:53 AM
Please find attached error.
06-13-2012 10:33 AM
Just add a task in Windows Scheduler with full path info, no need to edit the script.
06-13-2012 11:02 AM
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:
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.
06-13-2012 11:31 PM
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
06-14-2012 08:25 AM
Thanks you all. My issue has been resolved with your help.