# πŸ’Ύ 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. πŸ” **New:** Completed accounts are tracked per day. When you restart the bot after a failure, it skips accounts already finished and jumps directly to the remaining ones. **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, "skipCompletedAccounts": true, // Skip accounts already finished today "dir": "" // Empty = use default location } } ``` **Custom location:** ```jsonc { "jobState": { "enabled": true, "skipCompletedAccounts": true, "dir": "/custom/path/job-state" } } ``` > ℹ️ Set `skipCompletedAccounts` to `false` (or export `REWARDS_DISABLE_ACCOUNT_SKIP=1`/`true`) if you need to force every pass to run all accountsβ€”for example when using `passesPerRun` > 1 or when intentionally repeating the whole rotation in the same day. --- ## 🧹 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)**