skills/backup-and-recovery/SKILL.md
Query and analyze IBM i backup and recovery resources including save files, save file contents, media libraries, and tape cartridges via SQL services. Use when user asks about: (1) save file history or contents, (2) finding where an object was saved, (3) media library device status, (4) tape cartridge inventory, (5) backup verification, or (6) replacing DSPSAVF, WRKTAP, WRKMLBRM commands.
npx skillsauth add ajshedivy/ibmi-agent-skills backup-and-recoveryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query and analyze backup resources on IBM i using SQL services from QSYS2.
The ibmi CLI is the primary tool for executing backup queries. Set SKILL_DIR to this skill's installed location (the directory containing this SKILL.md file):
# SKILL_DIR = directory containing this SKILL.md
# Examples: ./skills/backup-and-recovery, ~/.claude/skills/backup-and-recovery
ibmi tools --tools "$SKILL_DIR/tools/" --toolset backup_and_recovery_default
ibmi tool get_save_file_info --tools "$SKILL_DIR/tools/"
ibmi sql "SELECT * FROM QSYS2.SAVE_FILE_INFO FETCH FIRST 10 ROWS ONLY"
List recent save files to verify backup schedule compliance
Find which save file contains a specific object for restore
List all objects in a specific save file before restoring
Check tape library devices before starting a backup job
List available tape cartridges and their current status
| CL Command | SQL Service | |------------|-------------| | DSPSAVF | SAVE_FILE_OBJECTS (table function) | | WRKTAP | TAPE_CARTRIDGE_INFO | | WRKMLBRM | MEDIA_LIBRARY_INFO |
Always scope by SAVE_FILE_LIBRARY — the unfiltered view scans every save file on the system and will time out.
SELECT SAVE_FILE_LIBRARY, SAVE_FILE, SAVE_TIMESTAMP, OBJECTS_SAVED, LIBRARY_NAME
FROM QSYS2.SAVE_FILE_INFO
WHERE SAVE_FILE_LIBRARY = 'QGPL'
ORDER BY SAVE_TIMESTAMP DESC
FETCH FIRST 20 ROWS ONLY;
Narrow to a specific save file library to avoid a full-system scan.
SELECT SAVE_FILE_LIBRARY, SAVE_FILE, OBJECT_NAME, SAVE_TIMESTAMP
FROM QSYS2.SAVE_FILE_OBJECTS
WHERE SAVE_FILE_LIBRARY = 'QGPL'
AND OBJECT_NAME = 'MYFILE'
ORDER BY SAVE_TIMESTAMP DESC;
SELECT DEVICE_NAME, DEVICE_STATUS, DEVICE_TYPE, DEVICE_MODEL,
RESOURCE_NAME, RESOURCE_STATUS, DEVICE_DESCRIPTION
FROM QSYS2.MEDIA_LIBRARY_INFO
ORDER BY DEVICE_NAME;
The tools/backup-and-recovery.yaml file provides 5 ready-to-use tools:
| Tool | Description |
|------|-------------|
| get_save_file_info | Save file metadata with timestamps and object counts |
| get_save_file_objects_view | Broad search across all save files |
| get_save_file_objects_detail | Targeted save file content inspection |
| get_media_library_info | Tape library device inventory |
| get_tape_cartridge_info | Tape cartridge status and location |
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" # Execute
ibmi tool <tool_name> --tools "$SKILL_DIR/tools/" --dry-run # Preview SQL
ibmi tools show <tool_name> --tools "$SKILL_DIR/tools/" # View details
tools
Query, monitor, and analyze jobs on IBM i using SQL table functions via the ibmi CLI. Use when user asks about: (1) finding jobs by status, user, subsystem, or type, (2) monitoring active job performance (CPU, I/O, memory), (3) detecting long-running SQL statements, (4) analyzing lock contention, (5) checking job queues, (6) scheduled jobs, (7) job logs, (8) replacing WRKACTJOB, WRKUSRJOB, WRKSBSJOB, WRKSBMJOB commands, or (9) any IBM i work management task.
testing
Monitor IBM i system health including CPU, memory, disk, ASPs, system limits, and network status via SQL services. Use when user asks about: (1) CPU utilization or system status, (2) memory pool sizes or page faults, (3) disk capacity or ASP usage, (4) system limits approaching thresholds, (5) TCP/IP connections and network status, (6) system activity overview, (7) replacing WRKSYSSTS, WRKDSKSTS, WRKTCPSTS commands, or (8) any system health monitoring task.
development
Monitor and analyze IBM i storage resources including ASPs, disk units, temporary storage, user storage consumption, and NVMe devices via SQL services. Use when user asks about: (1) ASP capacity, usage, or health, (2) disk unit status or I/O performance, (3) temporary storage consumption by jobs, (4) storage used per user profile, (5) NVMe device health, (6) IASP vary operations, or (7) replacing WRKDSKSTS, WRKSYSSTS storage info, or WRKSTG commands.
testing
Manage and analyze spooled files, output queues, and printer configurations on IBM i via SQL services. Use when user asks about: (1) listing or searching output queues, (2) viewing spooled file entries by queue, user, or status, (3) reading spool file content, (4) identifying top spool consumers or old spool files, (5) printer file definitions, (6) spool storage analysis, (7) replacing WRKSPLF, WRKOUTQ, WRKOBJLCK commands, or (8) any spool file management task.