# Database optimization always on thursday?

**URL:** <https://forums.plex.tv/t/database-optimization-always-on-thursday/929676>\
**Category:** General Discussions\
**Tags:** server-synology\
**Created:** [August 19, 2025, 12:51am UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676 "2025-08-19T00:51:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [August 19, 2025, 12:51am UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/1 "2025-08-19T00:51:54Z")

</div>

Maybe this is one for @ChuckPa

How does the butler plan weekly scheduled tasks (for example DB optimizing, clear bundle removing old cache files)? On my server Plex does it on thursday. Is this a plan by week days or does it rely on the day of the first installation? I’m asking because I want to let your DBRepair script run after Plex has finished the database maintenance.

---

<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:** [August 19, 2025, 3:19am UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/2 "2025-08-19T03:19:28Z")

</div>

I’ve never asked but mine runs on Tuesday so it would make sense to be based on date of installation.

I can find out if you want.

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [August 19, 2025, 10:33am UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/3 "2025-08-19T10:33:51Z")

</div>

> [@ChuckPa](#):
>
> I can find out if you want.

Yeah, this would be nice but no need to hurry. 😀  
I just realised that the database tasks are the one that take the longest time, Usually the optimize database, clean bundle and collect blob garbage are done pretty quick. The removing of old cached files usually take significantly more time but I think this is because of the high number of single files (it often removes 10’000+ files).

Speaking of scheduled tasks (a bit off topic): 😉  
Remember the problem we’ve talked a couple of months ago with mixed language? Some of the tasks are still in english. Most of them containing the `scanning` tag. Just to let you know… 📝

```auto
03:11 Der Butler hat die Datenbank gesichert.
03:07 Der Butler hat die Datenbank gesichert.
03:00 Verbindung zu Whydah hergestellt, wartet auf Ereignisse.
03:00 Kann keine Ereignisse auf Whydah empfangen.
02:57 Library scan complete: Extra information may still be downloading from the Internet
02:57 Scanning Super Bowl LIX - Kansas City Chiefs vs Philadelphia Eagles (2024-25)
02:57 Scanning the "Misc 2 (no Metadata)" section
02:52 Library scan complete: Extra information may still be downloading from the Internet
02:52 Scanning Super Bowl LIX - Kansas City Chiefs vs Philadelphia Eagles (2024-25)
02:52 Scanning the "Misc 2 (no Metadata)" section
02:19 Library scan complete: Extra information may still be downloading from the Internet
02:19 Scanning Super Bowl LIX - Kansas City Chiefs vs Philadelphia Eagles (2024-25)
02:19 Scanning the "Misc 2 (no Metadata)" section

```

> [@Status notifications are a mix of german and english](https://forums.plex.tv/t/status-notifications-are-a-mix-of-german-and-english/894107):
>
> In some scenarios the butler is writing the informations on “Einstellungen\>Benachrichtigungen” (Settings\>Notifications) in two different languages. First it writes the entry in english and after it the same in german. Here are some examples: \* 03:09 Der Butler ermittelt Werbung in 0 Serie(n). \* 03:09 The butler generated ad markers for 0 show(s). \* 03:08 The butler performed sonic analysis on 0 batches of albums. \* 03:08 The butler generated 0 season intro markers. \* 03:08 The butler refre…

---

<div class="post-metadata">

**Author:** ![MovieFan](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@MovieFan](https://forums.plex.tv/u/MovieFan)\
**Post date:** [August 19, 2025, 7:58pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/4 "2025-08-19T19:58:19Z")

</div>

Last time I looked the schedule was based on when pms starts. Just restart pms on the day you want it to run. It should run that night then weekly on the same day.

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [September 30, 2025, 9:00pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/5 "2025-09-30T21:00:50Z")

</div>

@ChuckPa  
Do you have any news about this? 😀

---

<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:** [September 30, 2025, 9:59pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/6 "2025-09-30T21:59:24Z")

</div>

@Fluamsler

Apologies, This fell off my to-do list.

Just looked in code and confirmed, YES, it’s 3 days from when PMS starts.

While I’d like to be able to set specific days for backup, It didn’t survive the viability discussion.

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [September 30, 2025, 10:57pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/7 "2025-09-30T22:57:58Z")

</div>

> [@ChuckPa](#):
>
> YES, it’s 3 days from when PMS starts.

@ChuckPa

So does this mean if I stop Plex for a week and start it on Sunday again the task DB maintenance would be moved to wednesday?

That brings me to another question: Because DSM on my DS224+ slowly uses more RAM over time I stop Plex every saturday at 12 PM for 3 minutes via scheduled tasks and start it again. But my “DB task” (optimizing DB, cleaning bundles and so on) runs on Thursday. I guess this does not count as restart?

---

<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:** [September 30, 2025, 11:49pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/8 "2025-09-30T23:49:16Z")

</div>

> [@Fluamsler](#):
>
> So does this mean if I stop Plex for a week and start it on Sunday again the task DB maintenance would be moved to wednesday?

Use Hours to make the math easier –

Start at midnight Sunday. 72 hours later, the maintenance will flag as being due.  
When Scheduled Tasks run, the DB backup / maintenance will run.

If you do anything manually before then, it doesn’t count toward the trigger counter.

---

<div class="post-metadata">

**Author:** ![Fluamsler](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/fluamsler/32/163641_2.png) [@Fluamsler](https://forums.plex.tv/u/Fluamsler)\
**Post date:** [October 1, 2025, 11:24pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/9 "2025-10-01T23:24:09Z")

</div>

@ChuckPa  
Maybe we were not talking about the same. 😉  
I didn’t mean the database backup. I mean the **Database Optimization/Clean Bundles** and Remove Temporary Files which only happens once a week.  
Since I’ve installed Plex this task always runs on Thursday (you said yours is on tuesday) and I don’t understand why it has to be a Thursday here. 😉

The only thing I do on my server is stopping Plex every now and then for an Update or maybe a power outtake about once a year (after the UPS shuts it down).

About the DB backups.: Yes, they run every three days. 😀 I’ve checked the backups in the Plex Folder and these files are from:  
Tuesday 30th,  
Saturday 27th  
Wednesday 24th and  
Sunday 21th of September.

So that matches with the 72 hours (and the change of days because you can’t divide 7 through 3 without leftovers)

---

<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:** [December 30, 2025, 11:25pm UTC](https://forums.plex.tv/t/database-optimization-always-on-thursday/929676/10 "2025-12-30T23:25:06Z")

</div>

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