NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
« Previous 1 … 11 12 13 14 15 … 37 Next »
Auto delete old recordings

 
  • 0 Vote(s) - 0 Average
Auto delete old recordings
eriberg
Offline

Junior Member

US
Posts: 4
Threads: 2
Joined: Feb 2023
#1
2023-03-01, 04:02 AM
I've been using NextPVR for about 2 months after my MythTV setup got borked.  I've got two things working that took some figuring:

The first is a ParallelProcessing.sh file that deletes the oldest recordings to make room for new recordings.  It will delete the oldest files to make a certain amount of free space on starting a new recording:  

Code:
#!/bin/bash cd /home/eriberg/TV &&   find . -type f -printf '%T@ %b :%p\0' |     sort -zrn |     gawk -v RS='\0' -v ORS='\0' '       BEGIN {max=400e9} # 10GiB; use max=10e9 for 10GB       {du += 512 * $2}       du > max {         sub("[^:]*:", ""); print       }' | xargs -r0 rm -f

It will delete files in folders, but not the folders, so I have my recordings in one folder.

The second is a script to run comskip when a recording is started.  I had trouble with comskip from /usr/local/bin or /usr/bin (compiled or from apt) randomly failing with a segmentation fault on my system, but comskip in a docker container worked.  This was written with the help of ChatGPT and watches the recordings folder and launches comskip in a docker container:

Code:
#!/bin/bash # Define the input and output folders INPUT_FOLDER="/home/eriberg/TV/NextPVR" # Start monitoring the input folder for new files inotifywait -m -e create "$INPUT_FOLDER" | while read path action file; do   if [[ "$file" =~ .*\.ts$ ]]; then     # Use Docker to run the Comskip container and process the new file     sleep 60     docker run -d -v "$INPUT_FOLDER:/data" -v "/etc:/data1" --rm comskip/comskip --ini=/data1/comskip.ini "/data/$file"   fi done wait

With these two things I have NextPVR working perfectly as my server and Kodi as the frontend.  I hope this helps somebody and I appreciate the support forum's help in figuring these things out.

Erik
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Migrated to new server, now nextpvr cant find recordings WagMan 7 985 2026-02-26, 01:45 AM
Last Post: WagMan
  Consistent Recordings Soapm 9 1,195 2026-01-16, 06:12 AM
Last Post: Soapm
  Direct access to recordings TugboatBill 1 1,296 2025-05-05, 11:04 PM
Last Post: mvallevand
  NextPVR 7 looses recordings after post processing ballfam 15 3,425 2024-12-20, 03:23 AM
Last Post: ballfam
  Recordings fail, sometimes while playing WagMan 9 2,654 2024-11-07, 12:46 PM
Last Post: mvallevand
  recordings fail, somtimes while playing WagMan 0 938 2024-11-02, 03:00 AM
Last Post: WagMan
  Random skipping in recordings ballfam 25 6,646 2024-04-29, 07:58 PM
Last Post: ballfam
  Failed Recordings sgar75 13 3,660 2024-04-23, 09:16 PM
Last Post: mvallevand
  failed recordings CDinger 11 3,077 2024-04-21, 03:29 AM
Last Post: CDinger
  No NVENC option in settings/transcoder and subtitles missing from ts recordings AWellesley 6 3,219 2024-03-04, 03:19 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode