
Yes, you can check if a gather_stats_job is running by querying your system's process list or task scheduler, depending on your operating system. On Linux or macOS, open a terminal and run ps aux | grep gather_stats_job — this will list all active processes containing that name. If you see a line with the job name, it’s currently running. On Windows, use the Task Manager or run tasklist /FI "IMAGENAME eq gather_stats_job.exe" in Command Prompt. Alternatively, if this job is a cron task or a scheduled script, check the cron table (crontab -l) or your scheduler’s logs. For database-backed jobs like those in PostgreSQL or MySQL, you can query system tables: for PostgreSQL, use SELECT * FROM pg_stat_activity WHERE query LIKE '%gather_stats%'; — a non-empty result means it’s active.
| Method | Command / Tool | What to Look For |
|---|---|---|
| Linux/macOS | `ps aux | grep gather_stats_job` |
| Windows | tasklist /FI "IMAGENAME eq gather_stats_job.exe" | The job listed in the output |
| PostgreSQL | SELECT * FROM pg_stat_activity WHERE query LIKE '%gather_stats%'; | Any returned rows with the query |
| Task Scheduler | crontab -l or Windows Task Scheduler GUI | The job marked as “running” or with a recent timestamp |
If the job is part of a custom monitoring system (like Nagios, Zabbix, or a simple script), check the job’s log file or the monitoring dashboard. I also recommend setting up a health check that pings the job every few minutes — this saves you from manually checking each time.

I usually just run ps aux | grep gather_stats_job on our Linux server. If nothing comes back, the job isn’t running. For a quick check, I also look at the job’s log file — if there’s no recent timestamp, it’s likely stopped. It’s that simple.

From my experience, the easiest way is to check the job’s status file or log. Many jobs write a “last run” timestamp or a “heartbeat” line. If the job is scheduled via cron, I run crontab -l to confirm it’s listed, then wait for the next run time. Quick and reliable.

I use a monitoring script that wraps the job. It writes a “still alive” marker every 60 seconds. If the marker stops being updated, I get an alert. For a manual check, I just look at that marker file’s modification time. It’s a lot more practical than endlessly grepping process lists.

On our team, we on the system’s process ID file. The job writes its PID to a file (e.g., /var/run/gather_stats_job.pid). I check if that PID exists with kill -0 $(cat /path/to/pidfile). If the command returns 0, the job is running. If it fails, the job has stopped. This method is bulletproof and avoids false positives.


