{"slug": "hf-jobs-can-i-delete-cron-job-history", "title": "HF Jobs: Can I delete cron job history?", "summary": "Hugging Face's HF Jobs offers no way to delete individual run receipts: `hf jobs cancel` only stops a running job and `hf jobs scheduled delete` removes the schedule, not the runs it already created, and the Python API (`list_jobs`, `inspect_job`, `cancel_job`, `fetch_job_logs`, `run_job`, `run_uv_job`) exposes no pruning method either. The recommended fix is to drop the polling cron job and instead create a bucket webhook that starts a Job directly, so each run corresponds to a real upload event; the guide also suggests setting a name and labels on scheduled jobs and filtering with `hf jobs ls -a --name bucket-watch --status failed`, since the default `hf jobs ps -a` view caps at 100 entries. The full pattern, including webhook payload fields such as `updatedFiles`, is documented in Hugging Face's webhook guide for processing new bucket files with Jobs.", "body_md": "On the delete part, the honest answer is no: there is no way to remove individual run receipts right now. `hf jobs cancel` only stops a running job, and `hf jobs scheduled delete` removes the schedule, not the runs it already created. The Python side is the same surface (`list_jobs`, `inspect_job`, `cancel_job`, `fetch_job_logs`, `run_job`, `run_uv_job`), so there is nothing to prune with there either.\n\nThe better news is that your workflow does not need the polling job at all. A webhook on the bucket can start a Job directly, so you get one run per real upload event instead of one run per tick. The history still gets an entry per run, but every entry then corresponds to actual work, which is the part that was bothering you.\n\nShape of it:\n\n```\nhf jobs run --flavor cpu-basic --timeout 2h \\\n  -e OUTPUT_BUCKET=you/analysis-out \\\n  ghcr.io/astral-sh/uv:python3.12-bookworm \\\n  uv run https://huggingface.co/.../analyze.py\nhf webhooks create --job-id <job id> \\\n  --watch bucket:you/incoming \\\n  --domain repo --secrets HF_TOKEN\nevent = json.loads(os.environ.get(\"WEBHOOK_PAYLOAD\", \"{}\"))\nfor f in event.get(\"updatedFiles\", []):\n    if f[\"action\"] != \"add\":\n        continue\n    path, size = f[\"path\"], f[\"size\"]\n    ...\n```\n\nDetails that matter in that setup:\n\n`--secrets HF_TOKEN` instead of to the Job.\nIf you want to keep the cron for other reasons, the next best thing is making the history readable rather than shorter. Set a name and labels on the scheduled job, then filter instead of scrolling:\n\n```\nhf jobs ls -a --name bucket-watch --status failed\nhf jobs ls -a --label kind=watcher\nhf jobs ps -a --limit 0   # default view caps at 100\n```\n\nTwo more things that help with the noise: fold the detect step and the analysis step into one job so each tick leaves one receipt instead of two, and have the job append a JSONL line (timestamp, files seen, action taken) to a log file in a bucket or dataset repo. Then that file is the one place you read, and the receipt list becomes something you only open when something failed.\n\nThe full pattern is written up here, including the payload fields: [Webhook guide: Process new files in a bucket with Jobs · Hugging Face](https://huggingface.co/docs/hub/webhooks-guide-bucket-jobs)\n\nI set up a fair number of these watcher pipelines for client automations, and dropping the poll loop is almost always what fixes the clutter, not pruning anything afterwards.", "url": "https://wpnews.pro/news/hf-jobs-can-i-delete-cron-job-history", "canonical_source": "https://discuss.huggingface.co/t/hf-jobs-can-i-delete-cron-job-history/191769#post_2", "published_at": "2026-11-12 12:22:46+00:00", "updated_at": "2026-11-12 12:52:17.302128+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "mlops"], "entities": ["Hugging Face", "HF Jobs", "uv", "ghcr.io/astral-sh/uv"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/hf-jobs-can-i-delete-cron-job-history", "markdown": "https://wpnews.pro/news/hf-jobs-can-i-delete-cron-job-history.md", "text": "https://wpnews.pro/news/hf-jobs-can-i-delete-cron-job-history.txt", "jsonld": "https://wpnews.pro/news/hf-jobs-can-i-delete-cron-job-history.jsonld"}}