# ๐Ÿ’พ Job State **Resume interrupted tasks automatically** --- ## ๐Ÿ’ก What Is It? Saves progress after each completed task. If script crashes or stops, it resumes exactly where it left off. **Already enabled by default!** --- ## โšก How It Works ### Progress Tracking ``` sessions/job-state/ โ”œโ”€โ”€ account1@email.com/ โ”‚ โ”œโ”€โ”€ daily-set-2025-10-16.json โ”‚ โ”œโ”€โ”€ desktop-search-2025-10-16.json โ”‚ โ””โ”€โ”€ mobile-search-2025-10-16.json โ””โ”€โ”€ account2@email.com/ โ””โ”€โ”€ ... ``` - โœ… **Per-account** โ€” Independent progress - โœ… **Date-specific** โ€” Fresh start each day - โœ… **Auto-cleanup** โ€” Old files remain for history --- ## ๐ŸŽฏ Benefits ### Interrupted Runs | Scenario | Without Job State | With Job State | |----------|-------------------|----------------| | **Power outage** | Start from beginning | Resume from last task | | **Manual stop** | Lose all progress | Pick up where left off | | **Network failure** | Redo everything | Continue remaining tasks | --- ## โš™๏ธ Configuration **Already enabled:** ```jsonc { "jobState": { "enabled": true, "dir": "" // Empty = use default location } } ``` **Custom location:** ```jsonc { "jobState": { "enabled": true, "dir": "/custom/path/job-state" } } ``` --- ## ๐Ÿงน Maintenance ### Reset Progress (Fresh Start) ```powershell # Reset all accounts Remove-Item -Recurse -Force sessions/job-state/ # Reset one account Remove-Item -Recurse -Force sessions/job-state/user@email.com/ ``` ### Cleanup Old Files ```powershell # Keep last 7 days only Get-ChildItem sessions/job-state -Recurse -Filter "*.json" | Where-Object {$_.LastWriteTime -lt (Get-Date).AddDays(-7)} | Remove-Item ``` --- ## ๐Ÿ› ๏ธ Troubleshooting | Problem | Solution | |---------|----------| | **Tasks not resuming** | Check file permissions | | **Duplicate execution** | Ensure system time is accurate | | **Excessive files** | Implement cleanup schedule | --- ## ๐Ÿ“š Next Steps **Need scheduler?** โ†’ **[Scheduler Guide](./schedule.md)** **Want diagnostics?** โ†’ **[Diagnostics Guide](./diagnostics.md)** --- **[โ† Back to Hub](./index.md)** | **[Config Guide](./config.md)**