Admin & Maintenance Tools

Standalone scripts for database maintenance and OAuth2 token management. None are called by the main pipeline — they are run manually when needed.

reset_all_scores.py

Wipes scored_job from every record in /home/john/.jobserve.gdbm, forcing a full re-analysis on the next pipeline run. Use after updating the CV or changing the scoring prompt.Usage: python3 reset_all_scores.py [--dry-run]Dry-run mode reports how many records would be affected without modifying the database.

reset_recent_analysis.py

Same idea but scoped: removes scored_job, score, and score_reason only from records dated within the last N days (default 3). Use to re-score recent jobs without re-processing the whole database.Usage: python3 reset_recent_analysis.py [--db PATH] [--days N]Has a small time cushion (~4.8 hours) so 'last 3 days' doesn't miss borderline records.

get_pop_refresh_token.py

One-time setup tool for obtaining the OAuth2 refresh token needed by popit3.py to connect to Outlook.com POP3.Uses MSAL device-flow authentication: run the script, visit the URL shown, enter the code, and the script outputs a ~/.netrc entry with the refresh token. That entry goes into ~/.netrc as:machine outlook.office365.com login <email> account MSAL:<client_id> password <refresh_token>The refresh token is long-lived but can expire if unused for 90 days. Re-run this script to obtain a new one.Requires: pip install msal

tmp_cleanup.py

Schedules deletion of temporary files via the at(1) command (default: 17:00 tomorrow). Safety: only accepts files whose basename starts with tmp_. Disabled by setting environment variable POPIT3_DISABLE_AT_CLEANUP.Not currently called automatically — available for scripts that create temp files to schedule their own cleanup.

version 1