# PACE OCI Operations

# XINA Import

## Overview

Cron jobs have been created to automate the import of the PACE/OCI telemetry archives into XINA. There are currently two separate jobs, but both work in a similar way: - ops\_oci - downloads OCI\*.oci archives and imports them into the XINA model "ops\_oci"
- ops\_pace - downloads HSK\*.HSK archives and imports them into the XINA model "ops\_pace"

The jobs have been scheduled to run every 10 minutes, performing the following:

1. Download up to 5 archives (configurable). Successfully downloaded archives are added to a local file "archiveIndex.txt". Archives in this file will not be downloaded again. If necessary, this file can be edited or even deleted to force the re-downloading of any previously downloaded archives.
2. Process the archive into 10-minute segments and remove science data packets (i.e., APIDs 700 and 720).
3. Upload the processed archives to the appropriate database/model in XINA.

**These cron jobs are currently running on the "xina-run" server (run-oci-xina-io) in the $HOME directory of the user "mrburkhart".**

## Bash Script Details## #### downloadArchives.sh

This script downloads archives using the "oci\_download" application. 



Arguments:

- FILTER : A file filter (e.g., oci\*.oci)
- MAX\_FILES : The maximum number of downloads to process
- DEST : The destination folder for downloaded archives
- START\_DATE: The start date to filter archives

Example: downloadArchives.sh "OCI\*.oci" 5 "$HOME/ops\_oci/raw" "12/04/2023"

#### segmentArchives.sh

This script processes archives into 10-minute segments using the "tmsegment" application. Arguments:

- MODEL : The XINA database/model name (example: 'debug')
- FILTER : A file filter (e.g., oci\*.oci)
- SOURCE : The source folder with raw archives
- DEST : The destination folder for segmented archives

Example: segmentArchives.sh ops\_oci "OCI\*.oci" "$HOME/ops\_oci/raw" "$HOME/ops\_oci/segmented"

#### uploadToXina.sh

This script uploads the processed archives to XINA using the "xina\_importarchive.sh" bash script. Arguments:

- MODEL : The XINA database/model name (example: 'debug')
- SOURCE : The source folder containing the segmented archives

Example: uploadToXina.sh ops\_oci "$HOME/ops\_oci/segmented"

#### check.sh

This script combines the above three scripts into a single script. 

# PACE OPS Data Flow

<div drawio-diagram="231"><img src="https://wiki.xina.io/uploads/images/drawio/2023-11/drawing-1-1701121301.png" alt=""/></div>