# \#purge

**URL:** https://forum.communityhealthtoolkit.org/tag/purge/197.md

[Latest](https://forum.communityhealthtoolkit.org/latest.md) · [Categories](https://forum.communityhealthtoolkit.org/categories.md) · [Tags](https://forum.communityhealthtoolkit.org/tags.md)

---

## [Setup purge config to always leave the most recent report (per type)](https://forum.communityhealthtoolkit.org/t/setup-purge-config-to-always-leave-the-most-recent-report-per-type/4583)

<div class="topic-metadata">

**Author:** [@Anro](https://forum.communityhealthtoolkit.org/u/Anro)\
**Replies:** 3\
**Last updated:** [January 21, 2026, 10:17am UTC](https://forum.communityhealthtoolkit.org/t/setup-purge-config-to-always-leave-the-most-recent-report-per-type/4583 "2026-01-21T10:17:35Z")

</div>

Per the discussion started here, we attempted to ensure that the newest record is always omitted during purge by implementing the following: module.exports = { run\_every\_days: 7, cron: '\*/5 \* \* \* \*', fn: function …

---

## [Purging Not Working Anymore](https://forum.communityhealthtoolkit.org/t/purging-not-working-anymore/5021)

<div class="topic-metadata">

**Author:** [@Gilbert](https://forum.communityhealthtoolkit.org/u/Gilbert)\
**Replies:** 3\
**Last updated:** [May 28, 2025, 2:18pm UTC](https://forum.communityhealthtoolkit.org/t/purging-not-working-anymore/5021 "2025-05-28T14:18:10Z")

</div>

Current Setup The purging process is scheduled using the cron literal 0 22 \* \* SAT, meaning it should run every Saturday at 22:00 UTC. Log analysis Querying the logs via: https(s)://\<host\>/medic-sentinel/\_all\_docs?end\_…

---

## [Integrating purge function in task tests](https://forum.communityhealthtoolkit.org/t/integrating-purge-function-in-task-tests/2422)

<div class="topic-metadata">

**Author:** [@bamatic](https://forum.communityhealthtoolkit.org/u/bamatic)\
**Replies:** 2\
**Last updated:** [February 14, 2023, 9:40pm UTC](https://forum.communityhealthtoolkit.org/t/integrating-purge-function-in-task-tests/2422 "2023-02-14T21:40:39Z")

</div>

Hi Community, If we have a task that depends on some report, par example, an assessment report, and the task has events with dueDate par exmaple every month, till 4 months later than assessment.reported\_date, but the a…

---

## [Access to purge logs](https://forum.communityhealthtoolkit.org/t/access-to-purge-logs/1826)

<div class="topic-metadata">

**Author:** [@bamatic](https://forum.communityhealthtoolkit.org/u/bamatic)\
**Replies:** 6\
**Last updated:** [April 13, 2022, 9:33pm UTC](https://forum.communityhealthtoolkit.org/t/access-to-purge-logs/1826 "2022-04-13T21:33:57Z")

</div>

Hi there, We are experimenting troubles with purge function, we have beed advised to upgrade to 3.14.2 version and to monitor purge logs. We’ve upgrade to 3.14.2 in our dev instance but we are not able to see the logs …

---

## [Controlling docs to sync with purge for a given user role](https://forum.communityhealthtoolkit.org/t/controlling-docs-to-sync-with-purge-for-a-given-user-role/1796)

<div class="topic-metadata">

**Author:** [@bamatic](https://forum.communityhealthtoolkit.org/u/bamatic)\
**Replies:** 3\
**Last updated:** [March 29, 2022, 2:49pm UTC](https://forum.communityhealthtoolkit.org/t/controlling-docs-to-sync-with-purge-for-a-given-user-role/1796 "2022-03-29T14:49:28Z")

</div>

In our cht app we have c50\_family-\>c40\_chw\_area-\>c30\_supervisor\_area-\>c20\_health\_area-\>c10\_site till now we have never before add a person to the c20\_health\_area but now we have create a user at a c20\_health\_area When …
