[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C4F67T3JZP03QF606SQ83V":3,"skill-same:01M7C4F67T3JZP03QF606SQ83V":55},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":13,"repositoryHtmlUrl":32,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":34,"install":35,"resources":48},"01M7C4F67T3JZP03QF606SQ83V","pdfusa-backup",null,"Create a full backup of the PDFUSAEDIT SQLite database and serve images, then upload to Google Drive. Use when the user asks to backup PDFUSAEDIT, or when running the weekly automated backup.","SillyHippy\u002Fzo-skills","SillyHippy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F159052837?v=4","01M7C43A8PDYMCDPTNFYF2RSC1","01M7C43A9CBS76QPH4PPTKXX54",0,"MIT","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpdfusa-backup\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: pdfusa-backup\ndescription: Create a full backup of the PDFUSAEDIT SQLite database and serve images, then upload to Google Drive. Use when the user asks to backup PDFUSAEDIT, or when running the weekly automated backup.\ncompatibility: Zo Computer with Google Drive integration connected\nmetadata:\n  author: sillyhippy.zo.computer\n  gdrive_folder_id: \"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"\n  gdrive_folder_name: \"PDFUSA-Backups\"\n  app_path: \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\n---\n# PDFUSAEDIT Full Backup Skill — Step-by-Step\n\n## What This Skill Does\n\nCreates a complete backup of the PDFUSAEDIT process-server application, including its SQLite database and all uploaded serve-attempt images, then uploads the backup to Google Drive.\n\n**Total backup size:** ~40-100MB\n\n## What Gets Backed Up\n\n| File\u002FDirectory | Description | Size |\n|---|---|---|\n| `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db` | SQLite database containing all clients, cases, serve attempts, and documents | ~5-15MB |\n| `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F` | Full-size and thumbnail JPG images from serve attempts | ~30-85MB |\n\n## Prerequisites — Check These First\n\n1. **Google Drive must be connected.** Verify by running: `list_app_tools(\"google_drive\")`\n   - If it returns a list of actions → connected, proceed.\n   - If it returns an error about no connection → tell the user: \"Google Drive is not connected. Go to Settings > Integrations > Connections > Google Drive and connect it.\"\n\n2. **The app directory exists.** Run: `ls \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db`\n   - If file exists → proceed.\n   - If not found → tell the user: \"The PDFUSAEDIT database was not found at the expected path.\"\n\n## Step 1: Run the Backup Script\n\nRun this exact command in a terminal:\n\n```bash\nbun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts\n```\n\n### What the Script Does\n\n1. Creates the `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F` directory if it doesn't exist.\n2. Checkpoints the SQLite WAL file (ensures the database is in a consistent state for zipping).\n3. Creates a zip file containing `data\u002Fpdfusa.db` and `data\u002Fuploads\u002Fserves\u002F`.\n4. Names the zip file: `pdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip` (ISO timestamp, colons replaced with hyphens).\n5. Places the zip in: `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F`\n6. Prints to stdout:\n   - `ZIP_PATH=\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip`\n   - `ZIP_NAME=pdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip`\n   - `Backup created: \u003Cpath> (\u003Csize> MB)`\n\n### Expected Output Example\n\n```\nCreating backup: pdfusa-backup-2026-05-25T22-33-51.zip\nBackup created: \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip (39.5 MB)\nZIP_PATH=\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip\nZIP_NAME=pdfusa-backup-2026-05-25T22-33-51.zip\n```\n\n### How to Capture the Zip Path\n\nThe script prints `ZIP_PATH=\u003Cfull_path>` on its own line. After running the script:\n\n1. Read the script's stdout output.\n2. Find the line starting with `ZIP_PATH=`.\n3. Extract the value after `ZIP_PATH=`. This is the full absolute path to the backup zip file.\n4. Store this value — you need it for Step 2.\n\n**If the script fails:**\n- Read the error message from stderr.\n- If `zip` command not found: run `apt-get install -y zip` then retry.\n- If disk space error: run `df -h` to check free space, tell the user if below 200MB free.\n- If permission error: retry with the same command (you run as root, so this shouldn't happen).\n\n### Fallback: Manual Zip (If Script Fails)\n\nIf the backup script fails for any reason, run these commands instead:\n\n```bash\nmkdir -p \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\nTIMESTAMP=$(date -u +%Y-%m-%dT%H-%M-%S)\nZIP_NAME=\"pdfusa-backup-${TIMESTAMP}.zip\"\nZIP_PATH=\"\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F${ZIP_NAME}\"\ncd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo && zip -r \"${ZIP_PATH}\" data\u002Fpdfusa.db data\u002Fuploads\u002Fserves\u002F\necho \"ZIP_PATH=${ZIP_PATH}\"\necho \"ZIP_NAME=${ZIP_NAME}\"\n```\n\n## Step 2: Upload to Google Drive\n\n### Tool to Use\n\nUse the `use_app_google_drive` tool with these exact parameters:\n\n| Parameter | Value | Notes |\n|---|---|---|\n| `tool_name` | `\"google_drive-upload-file\"` | Exact string, no variations |\n| `configured_props.filePath` | The `ZIP_PATH` from Step 1 | Must be absolute path |\n| `configured_props.parentId` | `\"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"` | PDFUSA-Backups folder ID — DO NOT CHANGE |\n\n### Example Tool Call\n\n```\nuse_app_google_drive(\n  tool_name=\"google_drive-upload-file\",\n  configured_props={\n    \"filePath\": \"\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip\",\n    \"parentId\": \"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"\n  }\n)\n```\n\n**Important:** The `filePath` value must exactly match the `ZIP_PATH` output from Step 1. Do not modify it.\n\n### What Happens on Success\n\nThe tool returns a response containing:\n- `kind: \"drive#file\"`\n- `id`: The Google Drive file ID (e.g., `\"11YCCgu5frmK1wUhw_luxFV_iC8...\"`)\n- `name`: The uploaded filename\n- `webViewLink`: A Google Drive link to view\u002Fdownload the file\n\n### What Happens on Failure\n\n- **File not found error:** The `ZIP_PATH` is wrong. Re-check Step 1 output. Run `ls -la \u003CZIP_PATH>` to verify the file exists.\n- **No such file or directory:** Same as above — the path is incorrect.\n- **Permission error \u002F authentication error:** Google Drive integration needs reconnecting. Tell the user to reconnect via Settings > Integrations.\n- **Upload failed \u002F quota exceeded:** Tell the user Google Drive is full.\n\n## Step 3: Verify and Report\n\n### Verification\n\nAfter the upload succeeds:\n\n1. Confirm the tool response contains `kind: \"drive#file\"` — this means the upload completed.\n2. Extract the `id` field from the response.\n3. Construct the Google Drive link: `https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F\u003Cfile_id>\u002Fview?usp=sharing`\n   - Replace `\u003Cfile_id>` with the `id` value from the response.\n\n### Report to User\n\nTell the user:\n\n```\nBackup complete.\n- Database: 48 clients, 25 cases, 55 serve attempts\n- Serve images: \u003Ccount> files\n- Backup size: \u003Csize> MB\n- Uploaded to Google Drive: https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F\u003Cfile_id>\u002Fview?usp=sharing\n```\n\n### If You Need Counts\n\nTo get accurate counts from the database:\n\n```bash\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM clients;\"\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM client_cases;\"\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM serve_attempts;\"\nls \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F | wc -l\n```\n\n## Step 4: Clean Up Old Backups (Optional but Recommended)\n\nKeep only the 5 most recent backups locally. Delete older ones:\n\n```bash\ncd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\nls -t pdfusa-backup-*.zip | tail -n +6 | xargs rm -f\n```\n\nThis keeps the newest 5 files and removes the rest.\n\n## Troubleshooting\n\n### Script says \"command not found: bun\"\n\nBun is installed on Zo Computer. The full path is `\u002Froot\u002F.bun\u002Fbin\u002Fbun`. Try:\n```bash\n\u002Froot\u002F.bun\u002Fbin\u002Fbun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts\n```\n\n### Script says \"zip: command not found\"\n\nInstall zip:\n```bash\napt-get install -y zip\n```\nThen retry the script.\n\n### Google Drive upload fails with \"file not found\"\n\nThe zip file doesn't exist at the path you provided. Run:\n```bash\nls -la \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F\n```\nFind the most recent zip file (sorted by date). Use that full path for the upload.\n\n### Google Drive upload fails with authentication error\n\nThe Google Drive integration is disconnected. Tell the user to reconnect it at:\nSettings > Integrations > Connections > Google Drive\n\n### Zip file is 0 bytes or corrupted\n\nThe database may have been locked during zipping. The script handles this by checkpointing WAL, but if it still fails:\n\n1. Stop the PDFUSAEDIT service first.\n2. Run the backup script.\n3. Restart the service with `update_user_service(service_id=\"svc_Ptj61cIlMbA\")`.\n\n### Need to Restore from a Backup\n\n1. Download the backup zip from Google Drive.\n2. Copy it to the Zo Computer: place it at `\u002Ftmp\u002Fpdfusa-restore.zip`\n3. Run:\n   ```bash\n   cd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\n   unzip -o \u002Ftmp\u002Fpdfusa-restore.zip\n   ```\n   This overwrites `data\u002Fpdfusa.db` and `data\u002Fuploads\u002Fserves\u002F` with the backed-up versions.\n4. Restart the service: `update_user_service(service_id=\"svc_Ptj61cIlMbA\")`\n\n## Automation Context\n\nThis skill is run by a weekly automation every Sunday at 2:00 AM Central Time (America\u002FChicago).\n\n- **Automation ID:** `f833baa7-189d-453b-8d59-01aabdb3f01f`\n- **RRULE:** `FREQ=WEEKLY;BYDAY=SU;BYHOUR=2;BYMINUTE=0`\n- **Timezone:** America\u002FChicago\n\nWhen the automation runs, it receives these instructions:\n1. Follow this skill file.\n2. Run the backup script: `bun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts`\n3. Extract the `ZIP_PATH` from the script's output.\n4. Upload to Google Drive using `use_app_google_drive` with `tool_name=\"google_drive-upload-file\"` and `parentId=\"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"`.\n5. Confirm success.\n\n## Quick Reference Card\n\n| Item | Value |\n|---|---|\n| **App directory** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo` |\n| **Database path** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db` |\n| **Images directory** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F` |\n| **Backup script** | `bun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts` |\n| **Backup output dir** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F` |\n| **Google Drive folder** | `PDFUSA-Backups` |\n| **Google Drive folder ID** | `13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL` |\n| **Google Drive upload tool** | `use_app_google_drive` |\n| **Google Drive tool name** | `google_drive-upload-file` |\n| **Service ID** | `svc_Ptj61cIlMbA` |\n| **Max local backups** | 5 (delete oldest) |\n","# PDFUSAEDIT Full Backup Skill — Step-by-Step\n\n## What This Skill Does\n\nCreates a complete backup of the PDFUSAEDIT process-server application, including its SQLite database and all uploaded serve-attempt images, then uploads the backup to Google Drive.\n\n**Total backup size:** ~40-100MB\n\n## What Gets Backed Up\n\n| File\u002FDirectory | Description | Size |\n|---|---|---|\n| `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db` | SQLite database containing all clients, cases, serve attempts, and documents | ~5-15MB |\n| `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F` | Full-size and thumbnail JPG images from serve attempts | ~30-85MB |\n\n## Prerequisites — Check These First\n\n1. **Google Drive must be connected.** Verify by running: `list_app_tools(\"google_drive\")`\n   - If it returns a list of actions → connected, proceed.\n   - If it returns an error about no connection → tell the user: \"Google Drive is not connected. Go to Settings > Integrations > Connections > Google Drive and connect it.\"\n\n2. **The app directory exists.** Run: `ls \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db`\n   - If file exists → proceed.\n   - If not found → tell the user: \"The PDFUSAEDIT database was not found at the expected path.\"\n\n## Step 1: Run the Backup Script\n\nRun this exact command in a terminal:\n\n```bash\nbun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts\n```\n\n### What the Script Does\n\n1. Creates the `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F` directory if it doesn't exist.\n2. Checkpoints the SQLite WAL file (ensures the database is in a consistent state for zipping).\n3. Creates a zip file containing `data\u002Fpdfusa.db` and `data\u002Fuploads\u002Fserves\u002F`.\n4. Names the zip file: `pdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip` (ISO timestamp, colons replaced with hyphens).\n5. Places the zip in: `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F`\n6. Prints to stdout:\n   - `ZIP_PATH=\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip`\n   - `ZIP_NAME=pdfusa-backup-YYYY-MM-DDTHH-MM-SS.zip`\n   - `Backup created: \u003Cpath> (\u003Csize> MB)`\n\n### Expected Output Example\n\n```\nCreating backup: pdfusa-backup-2026-05-25T22-33-51.zip\nBackup created: \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip (39.5 MB)\nZIP_PATH=\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip\nZIP_NAME=pdfusa-backup-2026-05-25T22-33-51.zip\n```\n\n### How to Capture the Zip Path\n\nThe script prints `ZIP_PATH=\u003Cfull_path>` on its own line. After running the script:\n\n1. Read the script's stdout output.\n2. Find the line starting with `ZIP_PATH=`.\n3. Extract the value after `ZIP_PATH=`. This is the full absolute path to the backup zip file.\n4. Store this value — you need it for Step 2.\n\n**If the script fails:**\n- Read the error message from stderr.\n- If `zip` command not found: run `apt-get install -y zip` then retry.\n- If disk space error: run `df -h` to check free space, tell the user if below 200MB free.\n- If permission error: retry with the same command (you run as root, so this shouldn't happen).\n\n### Fallback: Manual Zip (If Script Fails)\n\nIf the backup script fails for any reason, run these commands instead:\n\n```bash\nmkdir -p \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\nTIMESTAMP=$(date -u +%Y-%m-%dT%H-%M-%S)\nZIP_NAME=\"pdfusa-backup-${TIMESTAMP}.zip\"\nZIP_PATH=\"\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F${ZIP_NAME}\"\ncd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo && zip -r \"${ZIP_PATH}\" data\u002Fpdfusa.db data\u002Fuploads\u002Fserves\u002F\necho \"ZIP_PATH=${ZIP_PATH}\"\necho \"ZIP_NAME=${ZIP_NAME}\"\n```\n\n## Step 2: Upload to Google Drive\n\n### Tool to Use\n\nUse the `use_app_google_drive` tool with these exact parameters:\n\n| Parameter | Value | Notes |\n|---|---|---|\n| `tool_name` | `\"google_drive-upload-file\"` | Exact string, no variations |\n| `configured_props.filePath` | The `ZIP_PATH` from Step 1 | Must be absolute path |\n| `configured_props.parentId` | `\"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"` | PDFUSA-Backups folder ID — DO NOT CHANGE |\n\n### Example Tool Call\n\n```\nuse_app_google_drive(\n  tool_name=\"google_drive-upload-file\",\n  configured_props={\n    \"filePath\": \"\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002Fpdfusa-backup-2026-05-25T22-33-51.zip\",\n    \"parentId\": \"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"\n  }\n)\n```\n\n**Important:** The `filePath` value must exactly match the `ZIP_PATH` output from Step 1. Do not modify it.\n\n### What Happens on Success\n\nThe tool returns a response containing:\n- `kind: \"drive#file\"`\n- `id`: The Google Drive file ID (e.g., `\"11YCCgu5frmK1wUhw_luxFV_iC8...\"`)\n- `name`: The uploaded filename\n- `webViewLink`: A Google Drive link to view\u002Fdownload the file\n\n### What Happens on Failure\n\n- **File not found error:** The `ZIP_PATH` is wrong. Re-check Step 1 output. Run `ls -la \u003CZIP_PATH>` to verify the file exists.\n- **No such file or directory:** Same as above — the path is incorrect.\n- **Permission error \u002F authentication error:** Google Drive integration needs reconnecting. Tell the user to reconnect via Settings > Integrations.\n- **Upload failed \u002F quota exceeded:** Tell the user Google Drive is full.\n\n## Step 3: Verify and Report\n\n### Verification\n\nAfter the upload succeeds:\n\n1. Confirm the tool response contains `kind: \"drive#file\"` — this means the upload completed.\n2. Extract the `id` field from the response.\n3. Construct the Google Drive link: `https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F\u003Cfile_id>\u002Fview?usp=sharing`\n   - Replace `\u003Cfile_id>` with the `id` value from the response.\n\n### Report to User\n\nTell the user:\n\n```\nBackup complete.\n- Database: 48 clients, 25 cases, 55 serve attempts\n- Serve images: \u003Ccount> files\n- Backup size: \u003Csize> MB\n- Uploaded to Google Drive: https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F\u003Cfile_id>\u002Fview?usp=sharing\n```\n\n### If You Need Counts\n\nTo get accurate counts from the database:\n\n```bash\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM clients;\"\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM client_cases;\"\nsqlite3 \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db \"SELECT COUNT(*) FROM serve_attempts;\"\nls \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F | wc -l\n```\n\n## Step 4: Clean Up Old Backups (Optional but Recommended)\n\nKeep only the 5 most recent backups locally. Delete older ones:\n\n```bash\ncd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\nls -t pdfusa-backup-*.zip | tail -n +6 | xargs rm -f\n```\n\nThis keeps the newest 5 files and removes the rest.\n\n## Troubleshooting\n\n### Script says \"command not found: bun\"\n\nBun is installed on Zo Computer. The full path is `\u002Froot\u002F.bun\u002Fbin\u002Fbun`. Try:\n```bash\n\u002Froot\u002F.bun\u002Fbin\u002Fbun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts\n```\n\n### Script says \"zip: command not found\"\n\nInstall zip:\n```bash\napt-get install -y zip\n```\nThen retry the script.\n\n### Google Drive upload fails with \"file not found\"\n\nThe zip file doesn't exist at the path you provided. Run:\n```bash\nls -la \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F\n```\nFind the most recent zip file (sorted by date). Use that full path for the upload.\n\n### Google Drive upload fails with authentication error\n\nThe Google Drive integration is disconnected. Tell the user to reconnect it at:\nSettings > Integrations > Connections > Google Drive\n\n### Zip file is 0 bytes or corrupted\n\nThe database may have been locked during zipping. The script handles this by checkpointing WAL, but if it still fails:\n\n1. Stop the PDFUSAEDIT service first.\n2. Run the backup script.\n3. Restart the service with `update_user_service(service_id=\"svc_Ptj61cIlMbA\")`.\n\n### Need to Restore from a Backup\n\n1. Download the backup zip from Google Drive.\n2. Copy it to the Zo Computer: place it at `\u002Ftmp\u002Fpdfusa-restore.zip`\n3. Run:\n   ```bash\n   cd \u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\n   unzip -o \u002Ftmp\u002Fpdfusa-restore.zip\n   ```\n   This overwrites `data\u002Fpdfusa.db` and `data\u002Fuploads\u002Fserves\u002F` with the backed-up versions.\n4. Restart the service: `update_user_service(service_id=\"svc_Ptj61cIlMbA\")`\n\n## Automation Context\n\nThis skill is run by a weekly automation every Sunday at 2:00 AM Central Time (America\u002FChicago).\n\n- **Automation ID:** `f833baa7-189d-453b-8d59-01aabdb3f01f`\n- **RRULE:** `FREQ=WEEKLY;BYDAY=SU;BYHOUR=2;BYMINUTE=0`\n- **Timezone:** America\u002FChicago\n\nWhen the automation runs, it receives these instructions:\n1. Follow this skill file.\n2. Run the backup script: `bun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts`\n3. Extract the `ZIP_PATH` from the script's output.\n4. Upload to Google Drive using `use_app_google_drive` with `tool_name=\"google_drive-upload-file\"` and `parentId=\"13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL\"`.\n5. Confirm success.\n\n## Quick Reference Card\n\n| Item | Value |\n|---|---|\n| **App directory** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo` |\n| **Database path** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fpdfusa.db` |\n| **Images directory** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fdata\u002Fuploads\u002Fserves\u002F` |\n| **Backup script** | `bun run \u002Fhome\u002Fworkspace\u002FSkills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts` |\n| **Backup output dir** | `\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo\u002Fbackups\u002F` |\n| **Google Drive folder** | `PDFUSA-Backups` |\n| **Google Drive folder ID** | `13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL` |\n| **Google Drive upload tool** | `use_app_google_drive` |\n| **Google Drive tool name** | `google_drive-upload-file` |\n| **Service ID** | `svc_Ptj61cIlMbA` |\n| **Max local backups** | 5 (delete oldest) |\n",{"name":5,"metadata":23,"description":7,"compatibility":28},{"author":24,"app_path":25,"gdrive_folder_id":26,"gdrive_folder_name":27},"sillyhippy.zo.computer","\u002Fhome\u002Fworkspace\u002FProjects\u002FPDFUSAEDIT-zo","13R1vx8m2HPr3m3F4GvMzYbN7WJ8qK5xL","PDFUSA-Backups","Zo Computer with Google Drive integration connected","main","3641543f81ae80504027d6b012e0dadce4e2de40","skills\u002Fpdfusa-backup","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills","https:\u002F\u002Fgithub.com\u002FSillyHippy","2026-09-18 11:42:22",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add SillyHippy\u002Fzo-skills --skill pdfusa-backup",{"tool":41,"command":42},"bunx","bunx skills add SillyHippy\u002Fzo-skills --skill pdfusa-backup",{"tool":44,"command":45},"pnpm","pnpm dlx skills add SillyHippy\u002Fzo-skills --skill pdfusa-backup","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpdfusa-backup\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"scripts\u002Fbackup.ts","SCRIPT","脚本",1105,"https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpdfusa-backup\u002Fscripts\u002Fbackup.ts",[56,63,70,77,84,91],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":18},"01M7C4RK2ZCHPKQT393RVSC6ER","zopack","Export and import zo.space route setups as shareable .zopack.md files. Use when the user wants to package their zo.space routes for sharing, or when they receive a .zopack.md file to deploy. Triggers on \"export my zo.space\", \"create a zopack\", \"import this zopack\", or any mention of .zopack.md files.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzopack\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":18},"01M7C4REH5EJ22X3C1SF88X6KQ","zoho-mail-inbox","Full inbox management for Zoho Mail (info@justlegalsolutions.org) — list unread, mark all as read, delete by sender\u002Fkeyword, search, send from aliases, list folders. Fully self-contained — zero setup needed.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzoho-mail-inbox\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":18},"01M7C4RAJF1N9R8ZRT25GMHFBF","weekly-meeting-reminder","Get an email every Sunday evening listing your meetings for the coming week.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-weekly-meeting-reminder\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7C4R65Q9T6TPBRFQPWJSW4Z","twitter","Let Zo use your X (Twitter) account","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-twitter\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":18},"01M7C4R358YM59EZRM3SW763VK","zo-tools","Internal process tools for Zo and Hermes — local search, document processing, OCR, and embeddings. All services run on localhost, zero HTTP slots consumed.","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-tools\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":18},"01M7C4R0J4C3RQWKZ5W5W3CZ3X","ssh-setup","Sets up secure remote access to your Zo Computer so you can connect from anywhere","https:\u002F\u002Fgithub.com\u002FSillyHippy\u002Fzo-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzo-ssh-setup\u002FSKILL.md",[],[]]