mirror of
https://github.com/007revad/Linux_Plex_Backup.git
synced 2026-04-25 13:55:55 +03:00
[GH-ISSUE #21] Linux Plex Database backup snap #2
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/Linux_Plex_Backup#2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dave120uk on GitHub (Aug 30, 2025).
Original GitHub issue: https://github.com/007revad/Linux_Plex_Backup/issues/21
Hi,
the newer versions of ubuntu install plex using snap which means your backup script doesn't work. With the snap install of plex server the install is in var/snap/plexserver raher than /var/lib server. I have tired to amend your backup .sh file to make the changes required to get your script working with a snap install but could use some help or are you planning to create a backup script for snap install versions of plex server. Other differences are the way you start and stop the server with a snap install you use the command snap start plexserver and snap stop plexserver.
Hope you can help with this as i really want to get you script working with snap installs.
Dave
@007revad commented on GitHub (Aug 31, 2025):
It is "plexserver" or "plexmediaserver" ?
Does
/var/snap/plexserver/Library/Application Supportexist?EDIT Plex seems to be installed in:
/var/snap/plexmediaserver/common/Library/Application Support@007revad commented on GitHub (Aug 31, 2025):
Try https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.3.9
@dave120uk commented on GitHub (Aug 31, 2025):
My apologies its the following
snap start plexmediaserver
snap stop plexmediaserver
You are correct plex is installed in /var/snap/plexmediaserver/common/Library/Application Support.
I did try and edit your code but could only get so far. i will try the v1.3.9 you sent me the link for.
Thanks
@dave120uk commented on GitHub (Aug 31, 2025):
I tried v1.3.9 and get error plex media server data path invalid
/var/lib/plexmediaserver/Libary/Application Server
@dave120uk commented on GitHub (Aug 31, 2025):
I have got it working now it stops plex does the backup then starts plex again.
The only thing outstanding is when you run the script its complaining about /usr/lib/plexmediaserver not being valid or it can't find it but it has backed up everything to a tar.gz folder on my NAS. I will try restoreing plex server using the restore script to make sure it restores fine. I am currnelty testing this in a test environment before deplying on my live plex server.
I am very new to GitHub so it took me a while to work out and search how i could contact you. I will work out how the support / donate works and give you a donation for helping me.
Dave
@dave120uk commented on GitHub (Aug 31, 2025):
I have noticed for the snap install of plex the script is not picking up the plex server version its blank when you run the backup shell script. Could this be to do with the error with /usr/lib/plexmediaserver not being found? I'm not sure how checking the server version using command line differs between a deb install and a snap install of plex server but there does seems to be a difference somewhere. i have read that the snap install does store some plex data within the user home directory under a snap directory so maybe need to investigate /usr/lib/plexmediaserver being storeed under home directory/snap/plexmediaserver instead of usr/lib.
I will do a bit more digging and have a play and see what i can find out about where usr/lib/plexmediaserver is located in a snap install.
I can confirm the backup script does backup fine and the restore script does restore fine under a snap install.
The outstanding issue is the script not identifying the plex server version. Let me know if you want me to upload some screen grabs of the terminal window.
Dave
@007revad commented on GitHub (Sep 1, 2025):
I see why it's not getting the Plex version and is giving the /usr/lib/plexmediaserver not valid error.
Do either of these commands return the Plex version?
@dave120uk commented on GitHub (Sep 1, 2025):
Neither of them commands return the Plex version. When i look in usr directory there is no snap directory.
@007revad commented on GitHub (Sep 1, 2025):
Sorry. /usr should have /var
@dave120uk commented on GitHub (Sep 1, 2025):
There is the following directoryDo I need to run a command to get the server version or just input the path with —versionThis exists /var/snap/plexmediaserver/common/Libary/Application Support/Plex Media Server directorySent from my iPhoneOn 1 Sep 2025, at 08:29, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Sorry. /usr should have /var
/var/snap/plexmediaserver/Plex\ Media\ Server --version
/var/snap/plexmediaserver/common/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 1, 2025):
Run both these commands and tell me which one returned the Plex version.
@dave120uk commented on GitHub (Sep 1, 2025):
Both just return no such file or directory I can send you a photo if needed Sent from my iPhoneOn 1 Sep 2025, at 08:56, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Run both these commands and tell me which one returned the Plex version.
/var/snap/plexmediaserver/Plex\ Media\ Server --version
/var/snap/plexmediaserver/common/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 1, 2025):
Can you try:
@dave120uk commented on GitHub (Sep 1, 2025):
No such file or directory /snap/plexmediaserver/current exists but there is no usr directory Sent from my iPhoneOn 1 Sep 2025, at 09:33, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Can you try:
/snap/plexmediaserver/current/usr/lib/plexmediaserver/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
Would it help if we arranged a zoom or WhatsApp call and I can give you remote access to my test environment where I have a test plex server installed? Might be easier if you can see the install and look at the directory structure?Sent from my iPhoneOn 1 Sep 2025, at 09:33, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Can you try:
/snap/plexmediaserver/current/usr/lib/plexmediaserver/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
I’m a bit stumped at the moment. The commands you asked me to run all return no such file or directory so I had a dig in the file system and done some trial and error with —version with no joy.There has to be a command line way of querying the plex server version under a snap install it’s just a matter of finding it. Looked online but all I can find is the command for a .deb install.If you want to do a teamviwer session on my test environment let me know. It’s a stock install of Ubuntu jellyfish with a snap install of plex server which I use for testing before deploying on my live system.On 1 Sep 2025, at 09:33, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Can you try:
/snap/plexmediaserver/current/usr/lib/plexmediaserver/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 1, 2025):
The file we're looking for is named "Plex Media Server".
When you call that file with the --version option it returns the Plex version.
@007revad commented on GitHub (Sep 1, 2025):
According to google we could also use:
which would return an output like:
But then there's a potential problem if you have more than 1 version of Plex installed.
@007revad commented on GitHub (Sep 1, 2025):
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
@dave120uk commented on GitHub (Sep 1, 2025):
Not sure if this image will work Sent from my iPhoneOn 1 Sep 2025, at 23:55, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
ls -l /snap/plexmediaserver/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
That just lists permissions owner group date infoSent from my iPhoneOn 1 Sep 2025, at 23:55, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
ls -l /snap/plexmediaserver/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
Snap list plexmediaserver works but like you say if you have more than one plex server installed you run into issues Sent from my iPhoneOn 1 Sep 2025, at 23:55, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
ls -l /snap/plexmediaserver/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
Is there a coma d to search for the location of the file? Sent from my iPhoneOn 1 Sep 2025, at 23:55, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
ls -l /snap/plexmediaserver/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
In my home directory there is a Plex Mida Server file located in the following directory /home/dave/snap/plexmediaserver/current/I’m not sure if this is just a symlink though Sent from my iPhoneOn 1 Sep 2025, at 23:55, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Also according to goggle, current (in /snap/plexmediaserver/current) is a symlink that points to the currently active version of the Snap Plex package.
What does the following return:
ls -l /snap/plexmediaserver/
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 1, 2025):
Does this command return the version number?
@dave120uk commented on GitHub (Sep 1, 2025):
No such file or directory Sent from my iPhoneOn 2 Sep 2025, at 00:35, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Does this command return the version number?
/home/dave/snap/plexmediaserver/current/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@dave120uk commented on GitHub (Sep 1, 2025):
If I send a photo can you see it? Will send a photo of my terminal window showing the Plex Media Server file if you are able to see it Sent from my iPhoneOn 2 Sep 2025, at 00:35, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Does this command return the version number?
/home/dave/snap/plexmediaserver/current/Plex\ Media\ Server --version
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 1, 2025):
You can't send photos from your phone. You need to paste the photo into your comment on the website.
@007revad commented on GitHub (Sep 2, 2025):
Try:
@dave120uk commented on GitHub (Sep 2, 2025):
Run that and it returns the following
snap list plexmediaserver | head -n 2 | tail -n 1 | awk '{print $2}'~
awk: line 1: syntax error at or near ~
@007revad commented on GitHub (Sep 2, 2025):
I don't know how you ended up with ~ at the end.
The command is:
@dave120uk commented on GitHub (Sep 2, 2025):
My mistake
That worked!
snap list plexmediaserver | head -n 2 | tail -n 1 | awk '{print $2}'
1.42.1.10060-4e8b05daf
@dave120uk commented on GitHub (Sep 2, 2025):
Can we use this command to grab the Plex media server version in your scripts?I’ve had the backup script running hourly using a cron job all day retaining 5 backups and it works perfectly.If we can crack grabbing the server version then it’s sorted and can work with .deb and snap installs. On 2 Sep 2025, at 09:37, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
I don't know how you ended up with ~ at the end.
The command is:
snap list plexmediaserver | head -n 2 | tail -n 1 | awk '{print $2}'
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
@007revad commented on GitHub (Sep 2, 2025):
Here you go: https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.3.10
@dave120uk commented on GitHub (Sep 2, 2025):
Thanks Dave
will download and give it a test now.
@dave120uk commented on GitHub (Sep 2, 2025):
Spot on and working perfectly.
Linux_Plex_Backup v1.3.10
Latitude 6.8.0
Hostname: Latitude
Plex version: 1.42.1.10060
Stopping Plex...
Thank you so much for getting this working with snap.
@dave120uk commented on GitHub (Sep 2, 2025):
Backup and restore scripts working perfectly on a snap install. I will mark this issue as closed.Thanks again for getting it working. You are a true legend.On 2 Sep 2025, at 19:07, Dave Russell @.***> wrote:007revad left a comment (007revad/Linux_Plex_Backup#21)
Here you go: https://github.com/007revad/Linux_Plex_Backup/releases/tag/v1.3.10
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
kerem referenced this issue2026-03-04 19:17:27 +03:00