From ibmi-agent-skills
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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ibmi-agent-skills:backup-and-recoveryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Query and analyze backup resources on IBM i using SQL services from QSYS2.
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
npx claudepluginhub ajshedivy/ibmi-agent-skills --plugin ibmi-allGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.