Hi, is there a way to automate a DB backup in ARIS, e.g. by using a report? Is that possible? If yes, could you provide the code please. If no, any other option except backing up the whole ARIS environment?
Best Reply
Hi, here we are:
@echo off
setlocal enabledelayedexpansion
REM Set the backup directory
set BACKUP_DIR=C:\aris_backup
REM Create a folder with the current date and version
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a
set CURRENT_DATE=!datetime:~0,4!-!datetime:~4,2!-!datetime:~6,2!
set CURRENT_TIME=!datetime:~8,2!!datetime:~10,2!!datetime:~12,2!
set VERSION=!CURRENT_TIME: =0!
set BACKUP_FOLDER=%BACKUP_DIR%\%CURRENT_DATE%_%VERSION%
mkdir "!BACKUP_FOLDER!"
arisadm10 -s localhost:81 -t default -u system YOUR_PASSWORD reorg all
arisadm10 -s localhost:81 -t default -u system YOUR_PASSWORD backup all "!BACKUP_FOLDER!"
6 Replies
-
If you use Enterprise - there is one story, you need to create on the server .bat file with backup commands.
For Advanced we used macroses, e.g. when you log in DB it asks you to create a backup.
So for what version do you need?
-
Hi Alexander,
I am wondering why you can trigger a backup with a macro but not with a report. One is initiated by an action, and the other with a schedule. What is the difference?
However, I like the idea of having a .bat file on the server. Can you please provide me with the code, so that I can create a (weekly) backup of an ARIS DB?
-
Hi, here we are:
@echo off setlocal enabledelayedexpansion REM Set the backup directory set BACKUP_DIR=C:\aris_backup REM Create a folder with the current date and version for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set datetime=%%a set CURRENT_DATE=!datetime:~0,4!-!datetime:~4,2!-!datetime:~6,2! set CURRENT_TIME=!datetime:~8,2!!datetime:~10,2!!datetime:~12,2! set VERSION=!CURRENT_TIME: =0! set BACKUP_FOLDER=%BACKUP_DIR%\%CURRENT_DATE%_%VERSION% mkdir "!BACKUP_FOLDER!" arisadm10 -s localhost:81 -t default -u system YOUR_PASSWORD reorg all arisadm10 -s localhost:81 -t default -u system YOUR_PASSWORD backup all "!BACKUP_FOLDER!"
-
This code creates the folder with date and time in the directory 'C:\aris_backup', then it backups all DBs on the server, but instead of the command 'backup all' you can specify the name of the DB you need.
Then you need to set up window scheduler with this .bat file. Sometimes it is necessary to convert .bat to .exe, depends on your security policies
-
-