Backing up configuration remotely via HTTP and ZIP


It is fairly easy to configure the HTTP server and ZIP program to back up configuration data, initiated by a remote HTTP request. This technique is useful for situations such as fail-over, disaster recovery, or simple remote storage of backups. You can place the following script in the x-cg\R-BACKUP.bat folder, and then an HTTP request (such as via the wget.exe utility) can generate the backup and then download the backup ZIP file. This requires permissions to be modified for the x-cgi folder via a modification to the htaccess.txt file in that directory.

REM: # R-BACKUP.bat
REM: # Backup a files to the BACKUP_FILE_NAME zip file
REM: # This script can be launched via an HTTP request by
REM: # Storing this file in the "CorreLog\x-cgi" folder,
REM: # and modifying the "htaccess.txt" file in that folder.


set BACKUP_FILE_NAME=..\s-html\BACKUP.zip


REM: These are the folders to backup.
(
echo ../advisory
echo ../audit
echo ../c-alerts
echo ../config
echo ../dash
echo ../etext
echo ../excel
echo ../graph
echo ../net-snmp
echo ../net-user
echo ../query
echo ../s-html
echo ../t-actions
echo ../temp
echo ../u-agent
)> ziplist.txt
REM: # Zip the files here.

del /f %BACKUP_FILE_NAME%
type ziplist.txt |..\system\zip.exe -r -@ %BACKUP_FILE_NAME%
del /f ziplist.txt

REM: # Finished. The BACKUP_FILE_NAME has been created.


Warning

Note

The x-cgi folder normally requires authentication to execute any program within the folder. You need to modify the htaccess.txt file in that folder to permit the R-BACKUP.bat file (as mentioned) to be launched from a specific IP address or machine. You can then download the resulting BACKUP.zip file as a separate operation.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Command Center for Security 5.9