Archiware P5 Scripts

A small toolbox of shell scripts to inspect, export and manage Archiware P5 archives — CSV/TSV exports, tape mode checks, and API helpers.

What this repo contains

This collection is aimed at system administrators automating inventory and tape lifecycle tasks in Archiware P5. Each script is single-file shell (sh/bash) and includes CLI usage in the repository README.

API access scripts

Get the overview of recent archive jobs via the API, or check archive pool usage via the API.

Purpose: quick status & usage reporting for P5 via REST API.

jobs-sql2csv

Output all system, backup, and archive jobs ever into a CSV.

jobs-archive-only-sql2csv

Export only archive jobs into CSV for fast auditing.

volt2tsv

Create a TSV inventory file with contents for each P5 volume.

volt2tsv-archive-barcode

TSV inventory for archive volumes containing P5 volume and LTO barcode in the filename.

volume-archive-full2readonly

Find archive tapes marked "Full" and change their mode to "Readonly" (automated housekeeping).

volume-full-vs-appendable

Classify tapes: Full/Readonly vs Appendable and show used size in TiB.

volume-list

Create a P5 volume list as CSV and save it to /private/tmp/ (original Archiware CLI example, patched to write volume and file output).

Example usage

All scripts are tested on macOS in the Bash shell. Output is usually set to /private/tmp. With some slight modification these scripts should run in BSD / Linux systems with bash. They expect the Archiware CLI (nsdchat) to be installed where noted. Some scripts also use the open source project swiftDialog for notification with the Applescript fall back. Read all scripts before using and customize as needed. If you need help or have questions please reach out.

# Example: write all archive jobs to CSV in /private/tmp/
./jobs-archive-only-sql2csv.sh 

# Example: create per-volume TSV inventory in a custom directory
./vol2tsv-archive-barcode.sh /private/tmp/tsv_output

# Check tapes and change full 
./volume-archive-full2readonly.sh 
Single-file Shell macOS-friendly Admin-tools

Install & contribute

  1. Clone the repository to your admin machine.
  2. Make scripts executable: chmod +x *.sh
  3. Run with --help or inspect the header comments for usage and options.
  4. Contributions: open issues and PRs on GitHub. Add tests and macOS-specific fixes if needed.

If you're interested in apps based on these tools please contact me.