# Mosquitto.db file Automatic delete

**URL:** <https://forum.cedalo.com/t/mosquitto-db-file-automatic-delete/679>\
**Category:** Broker management and monitoring\
**Created:** [December 8, 2022, 6:07am UTC](https://forum.cedalo.com/t/mosquitto-db-file-automatic-delete/679 "2022-12-08T06:07:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthik\_rp](https://avatars.discourse-cdn.com/v4/letter/k/d78d45/32.png) [@karthik\_rp](https://forum.cedalo.com/u/karthik_rp)\
**Post date:** [December 8, 2022, 6:07am UTC](https://forum.cedalo.com/t/mosquitto-db-file-automatic-delete/679/1 "2022-12-08T06:07:03Z")

</div>

Hi Everyone

If i keep for 7 days persistance check my data while be stored inside the Mosquitto.db file on 7th day  
if i subscribe to the topic and Ethernet is pluged in i will get all the data to the broker which is stored inside the mosquitto.db file…how can we delete that mosquitto.db file or can it be automatically deleted after the data published to broker

---

<div class="post-metadata">

**Author:** ![roger.light](https://avatars.discourse-cdn.com/v4/letter/r/838e76/32.png) [@roger.light](https://forum.cedalo.com/u/roger.light)\
**Post date:** [December 13, 2022, 9:13am UTC](https://forum.cedalo.com/t/mosquitto-db-file-automatic-delete/679/2 "2022-12-13T09:13:21Z")

</div>

The behaviour you describe is exactly what should happen - once a message queued for a client session is delivered, it will be removed from the persistence store. If you are referring to retained messages however, the messages will only be removed when the retained message itself is removed - by sending a retained message to the same topic, but with a zero length payload.

I hope that helps.

Regards,

Roger
