STANAG On Demand
Version 1.1.4
|
Stanag On Demand Server Scripts** is a set of maintenance utilities for the StanagOnDemand server.
When no specific instructions are provided, the script obtains configuration information from the config.json file located in the sibling directory **./data** The following info is automatically extracted:
This info can be overridden by the explicit arguments provided to the script.
Short Command | Command | Description |
---|---|---|
-m | –mode | Modes: Backup or Restore DB / Export or Import mission |
-u | –uri | DB Uri |
-r | –root | Root folder for export / import. There may be one or more missions in that folder. |
-c | –collections | Collection array to export. Comma separated. All by default |
-d | –drop | Drop every collection from the target database before restoring the collection. Default: true |
-v | –video | Video folder location. If specified 'none', video is not backed up / restored |
–missions | When in the Mission export or import mode, provide missionId. Multiple (comma or space separated) missions can be provided. | |
–exportDbOnly | Export DB only. Skip video. Default - false. | |
–version | Script version |
Backup script will perform the following actions:
Copy config.json file found in data folder to the supplied root
Usage:*
For simplicity, the default script configuration can be run as a Windows batch file. The Output directory should be supplied with a parameter.
backup.bat**
Restore script will perform the following actions:
Note, by default, the document collections that exists in the DB will be dropped and the missions will be overwritten.
Usage:*
For simplicity, the default script configuration can be run as a Windows batch file. The Input (archive) directory should be supplied with a parameter.
restore.bat**
You can export one or more missions at once. Missions are exported as directories, containing assets and relevant db information.
Export* script will perform the following actions:
Copy missions assets found in videos to the supplied root
Usage:*
For single mission (by MissionId)
Or using batch file:
The resulting archive should look something like this:
For multiple missions (by MissionId)
The resulting archive should look something like this:
Import** script will perform the following actions:
The location of video assets is taken from the server's configuration file
Usage:*
For single mission import provide the name of the backed up mission folder.
Or using batch file:
For importing multiple missions (from one folder) provide the path to the folder
For example, as depicted below, the folder c:/tmp/backup contains 4 exported missions:
So, to import all missions, just provide a folder location as a –root argument: