vdrover 42 Posted December 31, 2021 Share Posted December 31, 2021 (edited) I have a few series set to record and save only the 3 latest episodes. This setting is not being respected and all recorded episodes of each series are being saved. Edited December 31, 2021 by vdrover Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 1, 2022 Share Posted January 1, 2022 Hi there, can you please go over a specific example? Thanks. Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 1, 2022 Author Share Posted January 1, 2022 Here are the series settings for Seinfeld: https://drops.treefla.me/04uL0n2v Only 3 episodes should be saved. But you can see here that currently there are 7 episodes. https://drops.treefla.me/rRuNvAjd Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 4, 2022 Author Share Posted January 4, 2022 @LukeNeed any more details here? Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 7, 2022 Share Posted January 7, 2022 On 1/4/2022 at 9:40 AM, vdrover said: @LukeNeed any more details here? Did you go into it to check that you even have seven episodes? Next time a Seinfeld episode records, please attach the emby server log as that is when the deletion occurs. Thanks. Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 7, 2022 Author Share Posted January 7, 2022 Yes, I did confirm that all the episodes were saved and counted properly. I deleted the episodes above. I currently have 3 saved from new recordings. I expect the 4th to record and save tonight. That will be one more than the "save 3" setting, and I will post the log details. Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 8, 2022 Share Posted January 8, 2022 5 hours ago, vdrover said: Yes, I did confirm that all the episodes were saved and counted properly. I deleted the episodes above. I currently have 3 saved from new recordings. I expect the 4th to record and save tonight. That will be one more than the "save 3" setting, and I will post the log details. Great, thanks. Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 8, 2022 Author Share Posted January 8, 2022 OK. I am PMing the server log for 1/7/22. The 4th episode of Seinfeld is called "The Implant". It's recording window was 11:05PM local for 30 minutes as you can see in the logs. This images show the series settings, and what I expected to happen based on those settings. Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 9, 2022 Share Posted January 9, 2022 Hi, looks like you have some file or folder permissions problems to sort out: 2022-01-07 23:08:02.368 Error LiveTV: Error deleting recording *** Error Report *** Version: 4.6.7.0 Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb Operating system: Linux version 5.4.0-91-generic (buildd@lcy01-amd64-017) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 Framework: .NET Core 3.1.21 OS/Process: x64/x64 Runtime: opt/emby-server/system/System.Private.CoreLib.dll Processor count: 12 Data path: /var/lib/emby Application path: /opt/emby-server/system System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path '/mnt/Media/Emby/TV Shows/Seinfeld (1981)/Season 4/Seinfeld S04E17 The Outing.ts' is denied. ---> System.IO.IOException: Permission denied --- End of inner exception stack trace --- at System.IO.FileSystem.DeleteFile(String fullPath) at Emby.Server.Implementations.Library.LibraryManager.DeleteItem(BaseItem item, DeleteOptions options, BaseItem parent, Boolean notifyParentItem) at Emby.LiveTV.EmbyTV.DeleteLibraryItemForTimer(TimerInfo timer) at Emby.LiveTV.EmbyTV.DeleteLibraryItemsForTimers(List`1 timers) Source: System.IO.FileSystem TargetSite: Void DeleteFile(System.String) InnerException: System.IO.IOException: Permission denied Source: TargetSite: 1 Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 9, 2022 Author Share Posted January 9, 2022 That’s helpful. I have been struggling with permissions as I migrate away from Plex. Any thoughts on lightning into my Emby as the “Emby” user? Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 9, 2022 Share Posted January 9, 2022 Have you taken a look at this? Link to comment Share on other sites More sharing options...
vdrover 42 Posted January 11, 2022 Author Share Posted January 11, 2022 (edited) Yes, I have been through that many times. However, based on the permissions issue you noted in the logs, I have found what is happening. I just don't WHT it is happening. Lwet me explain. So, I am transitioning from Plex and all my media is stored on an external drive (`mnt/Emby`) attached to my ubuntu box. I noticed some permissions problems earlier so I set up the following cron to run every 5 min: `/bin/chown -R emby:emby /mnt/Emby` In other words, all the files and folders are owned by `emby` and are in the `emby` group. This keeps the permissions as needed and allows me to delete content from the normal Emby interface. What I have JUST noticed is that AS SOON AS a new recording begins in EMBY, the permission on the entire external drive shift from emby:emby to `victor:plex`. Note that plex is not running any longer. Importantly, the episode cleanup issue I described above also takes place AS SOON AS the "4th" recording starts (since I am trying to save only 3 episodes), and the permissions are not correct. Once the cron kicks in to fix permissions, the episode cleanup process has already moved on and episodes remain. Also, I did a test using the `touch command`. I can replicate the changing of the file permissions independent of Emby by creating a new file on my external drive as follows: `sudo touch '/mnt/Emby/readme.txt'. So, I am hoping someone can suggest WHY, when I start recording to my external drive or copy a file to the external drive, the permissions on the entire external drive switch to victor:plex. Note: I am logged into Ubuntu as `victor`. Edited January 11, 2022 by vdrover Link to comment Share on other sites More sharing options...
Solution vdrover 42 Posted January 12, 2022 Author Solution Share Posted January 12, 2022 (edited) OK, I think I solved this. First, I suspect the external drive will always reset permissions to `victor:plex` when a file modification is made. I don't understand why, but I did see some posts about how the drive was installed originally and such. So I decided to take that as a given and work on permissions instead. In this approach, the problem to solve is allowing the `emby` user (i.e. the Emby app) to delete old episodes. First, I removed the crontab that was resetting permissions on `/mnt/Emby` to `emby:emby` . Now my permissions on the external drive would stay victor:plex. Second, I determined the userid of the emby user with this command: `less /etc/passwd`. Let's say the ID is `1001`. Finally, I set the following default ACL rule recursively on my external drive: `sudo setfacl -R --default --modify u:1001:rwx '/mnt/Emby'. This allowed the `emby` user to delete content on `mnt/Emby`. With this rule in place, old episodes were successfully purged according to that specified in the series settings. Edited January 12, 2022 by vdrover Link to comment Share on other sites More sharing options...
Luke 37095 Posted January 12, 2022 Share Posted January 12, 2022 Thanks for the feedback. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now