How to clean up the huge Cache folder?

Server Version#: 1.18.2.2058
Player Version#: n/a

The size of my PMS Cache folder is over 37 GB (it has over 6K files). How do I clean it up without destroying important data (posters, etc)? It seems like most of the bloat comes from the video files in the Cache\Transcode\Sync+ folder which is over 36 GB in size.

Is there something wrong with my Plex instance? Is the Cache folder supposed to be that big? If it matters, there are about 3K video files in the library.

In addition to taking that much space on the hard drive, another problem is that I cannot make backups, so need to solve this issue. I looked through posts about the Cache folder but did not find any instructions about cleaning it up. The articles seem to suggest that Plex cleans it up automatically, but it does not seem to be the case here.

This means that you or shared users whom you gave the ā€˜Sync’ privilege, have created Sync jobs which are not completely downloaded to the target device.

Very often this could be caused by

  • old app IDs, which are actually not in use anymore
  • user has created sync jobs for whole libraries, or tv shows, or music artists (often unconsciously) which were then subsequently halted, because the target device ran out of space

Old sync jobs which were created for devices which are no longer in use (e.g. the old or lost smart phone), get only cleared out automatically with extreme delay (several months).

Who is responsible and for which apps the Sync job was created, you can see only with Tautulli, atm. It has a separate section called Synced Items.
Only sync jobs where the ā€˜Downloaded’ column has a lower count than the ā€˜Converted’ column are actually taking up space on the server.

The screenshot below shows actually only sync jobs which are not taking up space on the server, because they are all download completely to the devices. (100% complete)

Only the user who created the sync job can clear it out again.
If the target device is no longer available, use the web app.
Settings - Status - Sync

Or use Tautulli. :slight_smile: (ā€˜Delete Mode’)


For backup purposes, I’d simply exempt the whole Transcode folder from the backup

2 Likes

Thank you. Assuming that I do not care about the sync jobs, can I just delete the folder under Sync+?

No, because they will eventually get recreated by the still-active sync jobs. You need to remove the sync jobs themselves. Removing them will clear out the Sync folders automatically.

1 Like

Thanks, Otto. Why, or why is the Transcode folder is not the top-level PMS folder? :slight_smile: Excluding subfolder is a major PITA (from the backup job perspective).

So, Tautulli shows that I have 91 items in the sync list with 4 last items failed and the rest complete. This is from the sync job I did in the beginning of summer (like 5 months ago). Why would they not be cleared by now?

I have no idea. I listed the most common reasons above already.

Rightly or wrongly I have been deleting the following two cache’s weekly …

/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Caches/com.plexapp.*
/var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Cache/*

I have a cron job setup calling a script to stop plex, nuke these and start again. This has helped keep my /var/lib/plexmediaserver backup around 8GB where before getting into this habit it has growning to over 50GB.

1 Like

And how do I delete them? I clicked the Delete button next to the items in Tautulli, but there is no button to submit. I refreshed the synced items and it just shows all of them with the Delete button next to the synced items.

1 Like

The user interface in Tautulli says it deletes them when you disengange the Delete Mode again.

1 Like

Oh, I see, I have to click the Delete Mode button again to actually delete them. Thanks again for your help.

Okay, so I deleted all sync jobs. Saw a couple of Failed to access uri endpoint /devices errors (in the Tautulli console), but most did not generate errors. The size of the Cache folder went down by 1 GB (so it’s about 36 GB now). When I try to refresh the sync jobs screen, I see the Tautulli warning: Unable to retrieve data for get_sync. Do I just wait?

This gives me an idea. Maybe I should add a step to the backup script to purge some folders (like the ones you mentioned) before starting the backup. Need to verify if this would cause unexpected effects.

I’d wait at least until after the next maintenance period.

1 Like

A few hours passed and it looks good now. Thanks a bunch, Otto. I just realized that I can easily exclude the Transcode folder from the backup by adding it to the configuration file (when backing up using 7-zip). Question: Should I also exclude the PhotoTranscoder folder (under Cache), or does this one need to be included in the backup?

I am not 100% sure, but I think you should leave that folder alone and back it up.
The Butler job ā€œRemove old cache files every weekā€ should keep it reasonably clean.

1 Like

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