I was wanting to make a request in regards to the Plex package because there’s a small annoyance.
After installing the package manually in DSM package manage to upgrade I have to re-go into the user control panel and re-add the users to the “plex” folder. Does it have to re-write the permissions to the folder each time or can there be an option to not do so?
As said, it’s not a huge problem, just an annoyance I’d like to see removed if possible.
I wish to augment the above with the procedure to move media without losing metadata.
It is written for Linux. DSM is a GUI on top of a base Linux operating system.
The procedure works the same. The path names change to be DSM-specific (e.g. /volume1/xxxxx)
I’m not sure if my request came accross not as intended, howeve, I don’t place my media in that folder as you suggest not to. My media is placed in folders as advised and I only want access to that folder for the intended purpose of backups or logs.
I just don’t want to keep having to apply the permission for my user to the share each time as there’s a link to it on my desktop.
I don’t wish for you to deviate and change the structure, just keep the permission there for users that have been assigned permissions to that folder… is that possible?
Very often I’m not, but if I need to restore the config it’s there and an easy process.
It’s not a huge issue but I always have to remember to enable the user access on an update in case I need access to the folder because I have a shortcut on my desktop.
There are Plex users with varying degrees of computer skills.
There are many cases where someone has gone into the Plex share, with the best of intentions, and broke it by copying something into the metadata structures.
They then come to me for support.
I spend several hours diagnosing
When I ultimately ask them to create a test server (renaming “Library” -> “Library.save” it magically works again.
It is at this point I often get the “Oh, yeah, I forgot to tell you I did This, That, and the Other thing”.
I am very concerned if you need to keep restoring the configuration on a regular basis and definitely want to explore that further.
Otherwise,
My advice?
Leave it alone until you need it. You don’t need it every day and after every update.
If you do want to run backups daily, I have a great way to automate that
Create a “Plex-Backups” share (or whatever name you wish to call it)
Now create a Scheduled Task,
a. It is a “user script”
b. it runs as the ‘root’ user
c. It’s “settings” are the commands to run and look like this (I will help you tweak as needed)
d. You can set the schedule in the Synology task GUI.
#!/bin/sh
# Stop Plex while we make the backup
"/var/packages/Plex Media Server/scripts/start-stop-status" stop
# Make a full backup of all the metadata, configuration, and databases
tar cfz /volume1/Plex-Backups/DailySnapshot.tar ./Library
# Restart PMS
"/var/packages/Plex Media Server/scripts/start-stop-status" start
# Set the permissions on the backup file so they can be accessed by the admin user
chown admin.users /volume1/Plex-Backups/DailySnapshot.tar
If you want to make the script automatically insert the day of the week into the file name, we can easily do that.
#!/bin/sh
# Stop Plex while we make the backup
"/var/packages/Plex Media Server/scripts/start-stop-status" stop
# What day of the week is it
Today="$(date '+%a')"
# Make a full backup of all the metadata, configuration, and databases
tar cfz "/volume1/Plex-Backups/${Today}_Snapshot.tar" ./Library
# Restart PMS
"/var/packages/Plex Media Server/scripts/start-stop-status" start
# Set the permissions on the backup file so they can be accessed by the admin user
chown admin.users "/volume1/Plex-Backups/${Today}_Snapshot.tar"
We can change that to be anything the date command returns.
%% a literal %
%a locale's abbreviated weekday name (e.g., Sun)
%A locale's full weekday name (e.g., Sunday)
%b locale's abbreviated month name (e.g., Jan)
%B locale's full month name (e.g., January)
%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
%C century; like %Y, except omit last two digits (e.g., 20)
%d day of month (e.g., 01)
%D date; same as %m/%d/%y
%e day of month, space padded; same as %_d
%F full date; same as %Y-%m-%d
%g last two digits of year of ISO week number (see %G)
%G year of ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
%I hour (01..12)
%j day of year (001..366)
%k hour, space padded ( 0..23); same as %_H
%l hour, space padded ( 1..12); same as %_I
%m month (01..12)
%M minute (00..59)
%n a newline
%N nanoseconds (000000000..999999999)
%p locale's equivalent of either AM or PM; blank if not known
%P like %p, but lower case
%q quarter of year (1..4)
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%s seconds since 1970-01-01 00:00:00 UTC
%S second (00..60)
%t a tab
%T time; same as %H:%M:%S
%u day of week (1..7); 1 is Monday
%U week number of year, with Sunday as first day of week (00..53)
%V ISO week number, with Monday as first day of week (01..53)
%w day of week (0..6); 0 is Sunday
%W week number of year, with Monday as first day of week (00..53)
%x locale's date representation (e.g., 12/31/99)
%X locale's time representation (e.g., 23:13:48)
%y last two digits of year (00..99)
%Y year
%z +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)
Be advised, some of these will not work well in this application. D/M/Y isn’t valid because / is directory separator character and will have very unexpected side effects unless you have a directory for every month and every day of the year.
Ahh that’s cool, i’ll keep that for reference. I think one per day rotating weekly will be enough. I don’t like to rely on 1 day just in case it’s corrupt or get’s overwritten with a bad copy before I get to the backups.
A very simple change, if you wished to keep a month’s worth of backups would be to change +%a to +%e (numeric day of the month). You would then rely on the date/time stamp (in English) to let you know where the wrap around has occurred.
You would also need put double quotes around the file name in both places because the Linux command line shell is space sensitive.
tar cfz "/volume1/Plex-Backups/${Today}_Snapshot.tar" ./Library
-and-
chown admin.users "/volume1/Plex-Backups/${Today}_Snapshot.tar"
See how much trouble you can get into?
Now you see why I’m protective of the share?
Okay, we’ll i’ve got plenty of space but i’ll start with a week and see how big they are before going for a month. I know the backups can get pretty big and my library is getting extensive now.
I did find a couple typos in the above so please be certain to doublecheck your copy with what I have posted now.
Yes, they can be. I have a pretty sizeable collection as well. On disk, it’s much bigger than what it is in the archive.
As example: a 4K byte file on disk (minimum allocation) is reduced to the bytes in it and the relative path to get there. If it’s a directory, it is only a name and a “D” flag.
If you wish, for purposes of timing, change tar cfz to tar cf.
this creates the archive without spending extra CPU to compress.
Doing so will also reduce the server down time.