Job Management Partner 1/Software Distribution Administrator's Guide Volume 2

[Contents][Glossary][Index][Back][Next]

5.3.2 Automatically backing up JP1/Software Distribution Manager

Of the data that is to be acquired as a backup of JP1/Software Distribution Manager (central manager and relay manager), the following items can be acquired automatically using the Windows task function and JP1/AJS:

For details about the data to be acquired, see 5.3.1 Manually backing up JP1/Software Distribution Manager.

(a) When to acquire a backup

Hitachi recommends that you back up data periodically after jobs have terminated or overnight. Because this data contains defined relationships, back up everything at the same time.

(b) Acquisition method

The following shows an example of a batch file for acquiring a backup in batch mode (for Microsoft SQL Server).

 
rem **********************************************************
rem * JP1/SD Manager Backup Script                           *
rem * SDBackUp.bat DMINSTALL_PATH BACKUP_PATH DATABASE_NAME  *
rem * DMINSTALL_PATH: Specifies the JP1/SD installation path *
rem * BACKUP_PATH   : Specifies the backup acquisition target*
rem * DATABASE_NAME : Specifies the name of JP1/SD database  *
rem **********************************************************
 
echo Starting the backup of JP1/Software Distribution Manager (%DATE% %TIME%)
 
 
rem Set the JP1/Software Distribution installation directory
set ARG1=%~1
set DMINSTALL_PATH=%ARG1%
 
rem Set the backup acquisition target
set ARG2=%~2
set BACKUP_PATH=%ARG2%
 
rem Set the database name
set ARG3=%~3
set DATABASE_NAME=%ARG3%
 
 
:SERVICE_STOP
echo Stopping the service "Remote Install Server"
net stop "Remote Install Server"
IF %ERRORLEVEL%==0 goto DB_BACKUP
  echo Stopping of the service "Remote Install Server" failed
  set BACKUP_RC=-1
  goto BACKUP_EXIT
 
 
:DB_BACKUP
echo Backing up the JP1/Software Distribution Manager database
echo (Using SQL Server's osql command to execute the BACKUP DATABASE statement and acquire a database backup)
osql -U sa -P password -Q "BACKUP DATABASE %DATABASE_NAME% TO DISK='%BACKUP_PATH%\NETMDB.bak'"
IF %ERRORLEVEL%==0 goto FILE_BACKUP
  echo Backup of the JP1/Software Distribution Manager database failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:FILE_BACKUP
echo Backing up JP1/Software Distribution packages and operation history files
call "%DMINSTALL_PATH%\bin\netmfile_backup.bat" /P /h /i "%DMINSTALL_PATH%" /b %BACKUP_PATH% /o %BACKUP_PATH%\Backup.log
IF %ERRORLEVEL%==0 goto OPERATION_SAVEFILE_BACKUP
  echo Backup of JP1/Software Distribution packages and operation history files failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:OPERATION_SAVEFILE_BACKUP
echo Backing up the JP1/Software Distribution operation history files (storage directory)
echo (applicable if operation history is backed up to the backup directory)
echo Source: Location specified for Storage directory on the Operation Monitoring page in the Server Setup dialog box
XCOPY C:\NETMDM\OPERATION_SAVE\* %BACKUP_PATH%\OPERATION_SAVE /I /S /E
IF %ERRORLEVEL%==0 goto AIM_DB_BACKUP
  echo Backup of the JP1/Software Distribution operation history files (storage directory) failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:AIM_DB_BACKUP
echo Backing up Asset Information Manager Subset (CSV format)
rem  If you use Asset Information Manager Subset, back up Asset Information Manager Subset to CSV files
 rem  When you back up Asset Information Manager Subset, stop the services in the following order:
 rem   1. World Wide Web Publishing Service or World Wide Web Publishing
 rem   2. Asset Information Synchronous Service and Asset Information Manager Subset commands and tasks
rem   3. JP1/Client Security Control - Manager (applicable if JP1/CSC is linked)
call "%DMINSTALL_PATH%\jp1asset\exe\jamdbexport.bat" %BACKUP_PATH%\AIMLimited -rp
rem  After the backup is acquired, start the services in the reverse order they were stopped.
IF %ERRORLEVEL%==0 goto AUDIT_LOG
  echo Backup of Asset Information Manager Subset (CSV format) failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:AUDIT_LOG
echo Backing up audit logs
echo (applicable if audit logs are collected)
echo Source: Location specified for Output directory for audit logs on the Audit Log page in the Server Setup dialog box
XCOPY C:\NETMDM\AUDIT\* %BACKUP_PATH%\AUDIT
IF %ERRORLEVEL%==0 goto COLLECT_FILE
  echo Backup of audit logs failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:COLLECT_FILE
echo Backing up the files obtained by remote collection (for relay manager)
echo (applicable if files are collected by the Collect files from client to relay system job)
echo Source: Work directory for remote file collection, which was specified in the Specify Work Directories dialog box during installation
echo          Setting path to the following registry:
echo          HKEY_LOCAL_MACHINE\SOFTWARE\HITACHI\NETM/DM/P\CollectionSitePath
echo          Default: JP1/Software-Distribution-installation-directory\DMPSITE\COLLECTION
XCOPY "%DMINSTALL_PATH%\DMPSITE\COLLECTION\*" %BACKUP_PATH%\COLLECTION /I /S /E
IF %ERRORLEVEL%==0 goto SITE_MNG_FILE1
  echo Backup of the files obtained by remote collection failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
 
:SITE_MNG_FILE1
echo Backing up various management files (for relay manager)
echo Source: JP1/Software-Distribution-installation-directory\MASTER\DB
echo           JP1/Software-Distribution-installation-directory\SITESRV
XCOPY "%DMINSTALL_PATH%\MASTER\DB\*" %BACKUP_PATH%\MASTER_DB /I /S /E
IF %ERRORLEVEL%==0 goto SITE_MNG_FILE2
  echo Backup of management files failed
  set BACKUP_RC=-1
  goto SERVICE_START
 
:SITE_MNG_FILE2
XCOPY "%DMINSTALL_PATH%\SITESRV\*" %BACKUP_PATH%\SITESRV /I /S /E
IF %ERRORLEVEL%==0 goto SERVICE_START
  echo Backup of management files failed
  set BACKUP_RC=-1
 
 
:SERVICE_START
echo Starting the service "Remote Install Server"
net start "Remote Install Server"
set BACKUP_RC=0
IF %ERRORLEVEL%==0 goto BACKUP_EXIT
  echo Starting of the service "Remote Install Server" failed
  set BACKUP_RC=-1
 
 
:BACKUP_EXIT
echo End of JP1/Software Distribution Manager backup (%DATE% %TIME%)

exit /b %BACKUP_RC%