# TMP database not cleaning up after backup

**URL:** <https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [June 21, 2025, 9:01pm UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742 "2025-06-21T21:01:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nello33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nello33/32/82328_2.png) [@Nello33](https://forums.plex.tv/u/Nello33)\
**Post date:** [June 21, 2025, 9:01pm UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/1 "2025-06-21T21:01:44Z")

</div>

Server Version#: 1.41.8.9834  
Player Version#: 4.147.1

TMP database not cleaning after Scheduled Tasks backup. The backup is successful, both main database and backup ones check out ok, no signs of corruption.

```auto
 "/usr/lib/plexmediaserver/Plex SQLite" /mnt/plexdata/Backups/Plex/com.plexapp.plugins.library.db-2025-06-11
SQLite version 3.39.4 2022-09-29 15:55:41
Enter ".help" for usage hints.
sqlite> PRAGMA integrity_check;
ok
sqlite> VACUUM;
sqlite>

```

But yet still it fails to cleanup, from the tmp database pile up this started happening sometime in December, unfortunate didn’t notice till last month and i have been trying to fix issue since then with no success.

---

<div class="post-metadata">

**Author:** ![OttoKerner](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/ottokerner/32/10079_2.png) [@OttoKerner](https://forums.plex.tv/u/OttoKerner)\
**Post date:** [June 23, 2025, 10:29am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/2 "2025-06-23T10:29:38Z")

</div>

The DB integrity check cannot catch all issues.  
A full export/import cycle is more thorough. Use this [GitHub - ChuckPa/DBRepair: Database repair utility for Plex Media Server databases](https://github.com/ChuckPa/DBRepair)

I seem to remembner that it might also be connected to a permission issue.

---

<div class="post-metadata">

**Author:** ![Nello33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nello33/32/82328_2.png) [@Nello33](https://forums.plex.tv/u/Nello33)\
**Post date:** [June 23, 2025, 4:45pm UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/3 "2025-06-23T16:45:50Z")

</div>

Issue was with backup share location. It seems for Plex to clean tmp database the user Plex is running as needs to be listed as owner of share files and folder even if permissions is 777.

Added uid=1003,gid=1003 to mount in fstab and last night the backup worked as expected.

```auto
//192.168.5.10/data /mnt/data cifs credentials=/root/.cifs/plex,uid=1003,gid=1003,dir_mode=0777,file_mode=0777

```

Question now is what changed to require ownership on share, as this has been working for years 🤔

---

<div class="post-metadata">

**Author:** ![Nello33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nello33/32/82328_2.png) [@Nello33](https://forums.plex.tv/u/Nello33)\
**Post date:** [June 26, 2025, 5:31am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/5 "2025-06-26T05:31:54Z")

</div>

No, it was permissions issue as mentioned in solution.

Sorry about the location confusion, I copy files out of original location when ever i want to work on them.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 26, 2025, 6:01am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/7 "2025-06-26T06:01:01Z")

</div>

If you’re running on a Linux host , mounting a Linux network share, why are you using CIFS when NFS makes this infinitely easier ?

---

<div class="post-metadata">

**Author:** ![Nello33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nello33/32/82328_2.png) [@Nello33](https://forums.plex.tv/u/Nello33)\
**Post date:** [June 27, 2025, 6:20am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/8 "2025-06-27T06:20:36Z")

</div>

Well not sure what to tell you. Already had dir\_mode and file\_mode 777 for years which stopped working in December, added uid=1003,gid=1003 to mount and now it works.

Specify uid=1003,gid=1003 in the mount fixed the issue which suggest Plex now has something checking file and/or backup directory ownership during backup.

---

<div class="post-metadata">

**Author:** ![Nello33](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/nello33/32/82328_2.png) [@Nello33](https://forums.plex.tv/u/Nello33)\
**Post date:** [June 27, 2025, 6:27am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/9 "2025-06-27T06:27:43Z")

</div>

Personal preference, I like CIFS better. Plus NFS that wound have had the same issue if uid and gid not specify.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [September 25, 2025, 6:27am UTC](https://forums.plex.tv/t/tmp-database-not-cleaning-up-after-backup/923742/10 "2025-09-25T06:27:52Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
