[GH-ISSUE #25] Plex Container Backup problems - different directory structure - script doesn't complete #1

Closed
opened 2026-03-07 19:20:50 +03:00 by kerem · 3 comments
Owner

Originally created by @RadTunesly on GitHub (Apr 6, 2025).
Original GitHub issue: https://github.com/007revad/Synology_Plex_Backup/issues/25

First of all I wanted to say thanks for the work you do. Your scripts have helped me immensely.

I've been using your Plex Backup script very successfully when Plex was installed directly on my Synology. I've since moved it to a container (image: ghcr.io/hotio/plex, v1.41.5.9522) which seems to have a different directory structure than what your script is looking for. In the defined base application data directory, these are the folders I have:

Image

The "~plex" folder only contains a reduced version of "Preferences.xml" as follows (nothing else exists in any of the other directories listed below, unless they are hidden):

/~plex/Library/Application Support/Plex Media Server/Preferences.xml

This version only defines MachineIdentifier and ProcessedMachineIdentifier whereas the copy in the base application data directory has all the standard variable definitions.

I'm using the latest version of your script and have defined Docker_plex_path as the base application data directory for the container.

I've made a change to line 336 where it is looking for the docker Logs file so it is looking only in the base application data directory (removing "Plex Media Server" from the path).
Plex_log="${Plex_Data_Path}/Logs/Plex Media Server.log"

I've also made a change to line 478 which defines PMS as "Plex Media Server" for creating the .tar, replacing it with an empty string ("").

When I run the script via Task Scheduler as root, I get the following output (the error log just shows the same errors listed below):

Synology DS923+ DSM 7.2.2-72806
Hostname: MYHOSTNAME
Plex version: 1.41.5.9522
Stopping Plex...
Checking status of Plex processes...
=================================================
Backing up Plex Media Server data files...
Only logging errors
tar: Removing leading `/' from member names
tar: /proc/irq/298/node: file changed as we read it
tar: /proc/irq/316/affinity_hint: file changed as we read it
tar: /proc/sys/net/ipv4/route/flush: Cannot open: Permission denied
tar: /proc/sys/net/ipv6/route/flush: Cannot open: Permission denied
tar: /proc/sys/vm/compact_memory: Cannot open: Permission denied
tar: /proc/sys/vm/drop_caches: Cannot open: Permission denied
Finished backing up Plex Media Server data files.
=================================================
Starting Plex...

Backup Started:  Sun Apr  6 16:15:10 AEST 2025
Backup Finished: Sun Apr  6 16:38:51 AEST 2025
Backup Duration: 0d:00h:23m:41s

WARNING Plex backup had errors! See error log:
DS923_20250403_Plex_1.41.5.9522_Backup_ERROR.log

The script takes a long time to run (most I gave it was 3 hours) and I believe in changing PMS value to an empty string, tar is trying to backup from "/" so is trying to back up far more than it needs to inside the container directory (or is it now trying to back up the entire contents of my DiskStation?). I have to use SSH to kill it with command kill -15 <PID>, which seems to be why it exits cleanly and restarts the container. The Permission Denied errors surprised me as I thought "root" should have access. There is only a single non-admin user with access to the application data directory.

I'm pretty new to containers and scripting in general so the most likely explanation is that I've missed something or am not understanding Synology user/root permissions properly (likely both).

Do you have any advice on what I could do to get it going?

Thanks for your time.

Originally created by @RadTunesly on GitHub (Apr 6, 2025). Original GitHub issue: https://github.com/007revad/Synology_Plex_Backup/issues/25 First of all I wanted to say thanks for the work you do. Your scripts have helped me immensely. I've been using your Plex Backup script very successfully when Plex was installed directly on my Synology. I've since moved it to a container (image: ghcr.io/hotio/plex, v1.41.5.9522) which seems to have a different directory structure than what your script is looking for. In the defined base application data directory, these are the folders I have: ![Image](https://github.com/user-attachments/assets/cbf40d80-c3d3-445b-8d0c-3bb387d35aeb) The "~plex" folder only contains a reduced version of "Preferences.xml" as follows (nothing else exists in any of the other directories listed below, unless they are hidden): `/~plex/Library/Application Support/Plex Media Server/Preferences.xml` This version only defines `MachineIdentifier` and `ProcessedMachineIdentifier` whereas the copy in the base application data directory has all the standard variable definitions. I'm using the latest version of your script and have defined `Docker_plex_path` as the base application data directory for the container. I've made a change to line 336 where it is looking for the docker Logs file so it is looking only in the base application data directory (removing "Plex Media Server" from the path). `Plex_log="${Plex_Data_Path}/Logs/Plex Media Server.log"` I've also made a change to line 478 which defines `PMS` as `"Plex Media Server"` for creating the .tar, replacing it with an empty string (`""`). When I run the script via Task Scheduler as root, I get the following output (the error log just shows the same errors listed below): ``` Synology DS923+ DSM 7.2.2-72806 Hostname: MYHOSTNAME Plex version: 1.41.5.9522 Stopping Plex... Checking status of Plex processes... ================================================= Backing up Plex Media Server data files... Only logging errors tar: Removing leading `/' from member names tar: /proc/irq/298/node: file changed as we read it tar: /proc/irq/316/affinity_hint: file changed as we read it tar: /proc/sys/net/ipv4/route/flush: Cannot open: Permission denied tar: /proc/sys/net/ipv6/route/flush: Cannot open: Permission denied tar: /proc/sys/vm/compact_memory: Cannot open: Permission denied tar: /proc/sys/vm/drop_caches: Cannot open: Permission denied Finished backing up Plex Media Server data files. ================================================= Starting Plex... Backup Started: Sun Apr 6 16:15:10 AEST 2025 Backup Finished: Sun Apr 6 16:38:51 AEST 2025 Backup Duration: 0d:00h:23m:41s WARNING Plex backup had errors! See error log: DS923_20250403_Plex_1.41.5.9522_Backup_ERROR.log ``` The script takes a long time to run (most I gave it was 3 hours) and I believe in changing PMS value to an empty string, tar is trying to backup from "/" so is trying to back up far more than it needs to inside the container directory (or is it now trying to back up the entire contents of my DiskStation?). I have to use SSH to kill it with command `kill -15 <PID>`, which seems to be why it exits cleanly and restarts the container. The Permission Denied errors surprised me as I thought "root" should have access. There is only a single non-admin user with access to the application data directory. I'm pretty new to containers and scripting in general so the most likely explanation is that I've missed something or am not understanding Synology user/root permissions properly (likely both). Do you have any advice on what I could do to get it going? Thanks for your time.
kerem closed this issue 2026-03-07 19:20:50 +03:00
Author
Owner

@RadTunesly commented on GitHub (Jul 31, 2025):

Turns out even if you make something perfect and idiot proof, they will just build a better idiot. Feel free to delete this disaster.

Appreciate your good work.

<!-- gh-comment-id:3138372653 --> @RadTunesly commented on GitHub (Jul 31, 2025): Turns out even if you make something perfect and idiot proof, they will just build a better idiot. Feel free to delete this disaster. Appreciate your good work.
Author
Owner

@007revad commented on GitHub (Jul 31, 2025):

@RadTunesly Sorry I didn't answer this back in April. I'd just moved into my new home and was very busy.

<!-- gh-comment-id:3138535809 --> @007revad commented on GitHub (Jul 31, 2025): @RadTunesly Sorry I didn't answer this back in April. I'd just moved into my new home and was very busy.
Author
Owner

@RadTunesly commented on GitHub (Jul 31, 2025):

Not at all mate, I had overlooked some of your very explicit instructions and went looking for zebra instead of seeing horse. The moment I came back to it with a fresh set of eyes it was very clear, as are your instructions.

<!-- gh-comment-id:3138582024 --> @RadTunesly commented on GitHub (Jul 31, 2025): Not at all mate, I had overlooked some of your very explicit instructions and went looking for zebra instead of seeing horse. The moment I came back to it with a fresh set of eyes it was very clear, as are your instructions.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Synology_Plex_Backup#1
No description provided.