PMS keeps tmp files in the Databases directory

Server Version#: 1.26.0.5715

Hi All,
PMS keeps some db-tmp files in the Databases folder and doesn’t delete then upon backup.
I have network folder mounted to /mnt/backup, where PMS stores its backups and it actually does, but for some reason it doesn’t remove those identical files from database folder:

Here is what i have now in database folder:

:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases$ ls -l  total 1645600
-rw-r--r-- 1 plex plex     25600 May  7  2021 com.plexapp.dlna.db
-rw-r--r-- 1 plex plex     32768 May  7  2021 com.plexapp.dlna.db-shm
-rw-r--r-- 1 plex plex    110072 May  7  2021 com.plexapp.dlna.db-wal
-rw-r--r-- 1 plex plex 201673728 May  6 01:02 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 plex plex 198144000 Apr 29 01:02 com.plexapp.plugins.library.blobs.db-2022-04-29-tmp
-rw-r--r-- 1 plex plex 201675776 May  2 01:02 com.plexapp.plugins.library.blobs.db-2022-05-02-tmp
-rw-r--r-- 1 plex plex 201675776 May  5 01:00 com.plexapp.plugins.library.blobs.db-2022-05-05-tmp
-rw-r--r-- 1 plex plex 201673728 May  8 01:02 com.plexapp.plugins.library.blobs.db-2022-05-08-tmp
-rw-r--r-- 1 plex plex     32768 May  9 15:19 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r-- 1 plex plex         0 May  9 15:19 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r-- 1 plex plex 137314304 May 10 15:23 com.plexapp.plugins.library.db
-rw-r--r-- 1 plex plex 134221824 Apr 29 01:01 com.plexapp.plugins.library.db-2022-04-29-tmp
-rw-r--r-- 1 plex plex 132595712 May  2 01:01 com.plexapp.plugins.library.db-2022-05-02-tmp
-rw-r--r-- 1 plex plex 136159232 May  5 01:00 com.plexapp.plugins.library.db-2022-05-05-tmp
-rw-r--r-- 1 plex plex 135159808 May  8 01:02 com.plexapp.plugins.library.db-2022-05-08-tmp
-rw-r--r-- 1 plex plex     32768 May 10 15:27 com.plexapp.plugins.library.db-shm
-rw-r--r-- 1 plex plex   4536152 May 10 15:27 com.plexapp.plugins.library.db-wal

And this is mounted backup folder (as you see backup size is identical, the only exception is file name which ends with -tmp in Databases folder):

/mnt/backup$ ls -l
total 1007787
-rwxrwxrwx 1 root root 198144000 Apr 29 01:02 com.plexapp.plugins.library.blobs.db-2022-04-29
-rwxrwxrwx 1 root root 201675776 May  2 01:02 com.plexapp.plugins.library.blobs.db-2022-05-02
-rwxrwxrwx 1 root root 201675776 May  5 01:00 com.plexapp.plugins.library.blobs.db-2022-05-05
-rwxrwxrwx 1 root root 201673728 May  8 01:02 com.plexapp.plugins.library.blobs.db-2022-05-08
-rwxrwxrwx 1 root root 134221824 Apr 29 01:01 com.plexapp.plugins.library.db-2022-04-29
-rwxrwxrwx 1 root root 132595712 May  2 01:01 com.plexapp.plugins.library.db-2022-05-02
-rwxrwxrwx 1 root root 136159232 May  5 01:00 com.plexapp.plugins.library.db-2022-05-05
-rwxrwxrwx 1 root root 135159808 May  8 01:02 com.plexapp.plugins.library.db-2022-05-08

Does anybody knows why is it happening?

Thanks.

Those files are created when Plex tries to create a backup file every 3 days. If you are not receiving messages from Plex that “Database Backup Successful” then I would do database repair on the library and blogs db’s.

Also the permissions on the backup folder should be plex:plex . Who owns /mnt/backup?

1 Like

Hi,
Is it really mandatory plex to be owner of the backup folder?
Currently root is the owner, but ACL is as follows rwxrwxrwx - should be enough. And as we can see PMS is able to write backups there, the problem is that it don’t clean up tmp files once backup is done.

Checked the logs and found following:
Couldn't rename file "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-2022-05-08-tmp" to "/mnt/backup/com.plexapp.plugins.library.db-2022-05-08": Operation not permitted

So you might be right.
Changed fstab option to make plex:plex owner of the mounted folder.
Let’s check on how backup will go tonight.

Thanks.

You should verify the correct permission inheritance by unmounting the backup drive, chmod plex:plex /mnt/backup then remount.

yes. the issue is solved now.
Thanks for your help.

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