OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

@bnhf Is it possible for you to add a script that can be run say hourly/OnDemand to do a backup ? ... Doing a hourly backup saved my ass last night.

Seems like it would be easy enough. Are you thinking of something triggered by the API? And, if so, do you know the API endpoint?

Otherwise, access via the LOGS_SHARE value should work too, saving to a location under DVR_SHARE (pretty much what's happening now afaik).

Since there are already daily backups going back 30 days, maybe this would be the type of backup where the previous backup would simply be overwritten? With the interval user-defined in the OliveTin Action?

EDIT: Using the API may not be the way to go, as this may result in 30 hours worth of hourly backups, rather than 30 days worth of daily backups. Something along the lines of an hourly snapshot, separate from the CDVR backups?

This is what I use .... Right now running it when nothing is recording. Going back 30 days would really suck lol .. lots of orphaned recordings that is why I set mine up to every hour or 2.

curl -XPOST http://serverip:8089/backups

So what do you see in your Database folder? 30 backups happening more-or-less every hour (other than during active recordings)?

New bnhf/olivetin:latest (aka bnhf/olivetin:2024.11.30) pushed today with support for a custom backup interval for a CDVR server database (multiple servers supported). Without using this Action, CDVR database backups are performed by default once per day -- with the last 30 saved. This new Action allows for a faster tempo of backups (for example every 4 hours, or every hour), with the backup performed only if there are no recordings in progress.

There's also an optional healthchecks.io integration, which will receive a ping on every successful backup. That way, if no such pings are received in x hours, you'll get an e-mail. So, you could have your backups set for every hour, with healthchecks.io set to expect a ping at least every 12 hours (for example). That way (in this example) you can be confident you're getting at least 2 backups a day, even with a busy DVR.

screenshot-htpc6-2024.11.30-10_07_51

I set my batch file a little different ... on initial startup of my batch I set the backupneeded flag to yes
It will check to see if is recording ... if it is recording it will keep looping every five minutes ...then if nothing is recording it will back it up and set backupneeded flag to no and wait an hour to check for recording again if it is recording it will set backupneeded flag to yes... and loop every 5 minutes again....

This way it will only do a backup if it has recorded something since the last backup.

CD /d "%~dp0"
set backupneeded=yes

:loop
cls
title "Backup Channels DVR"
curl.exe "http://127.0.0.1:8089/dvr" | findstr  /I /C:"Recording"
set recording=%ERRORLEVEL%

if %recording% EQU 0 set backupneeded=yes

if %recording% NEQ 0 if %backupneeded% EQU yes curl -XPOST http://127.0.0.1:8089/backups

if %recording% NEQ 0 set backupneeded=no
if %recording% EQU 0 timeout /T 300
if %recording% NEQ 0 timeout /T 3600
goto loop

This is awesome, I've leveraged it to solve a long-standing problem on my system... moving recordings to my file server after recording locally to the DVR

@bnhf is there any way to check for updates for multple Channels instances without spinning up another olivetin container. I'm using slm/plm to feed my "main" Channels server and I got a TVE only container up too to do that so I'm wondering if you could update the script to run with 2 urls instead of one

Are you talking about the "Keep CDVR Server Updated to Latest Pre-Release" Action? If so, yes that supports multiple server instances, but they need to be defined when you spin-up OliveTin:

1 Like

Are you talking about using it on multiple Channels DVR servers?
This is what I do
in the compose

    environment:
      - CHANNELS_DVR=${CHANNELS_DVR_HOST}:${CHANNELS_DVR_PORT} # Add your Channels DVR server in the form CHANNELS_DVR_HOST=<hostname or ip> and CHANNELS_DVR_PORT=<port>.
      - CHANNELS_DVR_ALTERNATES=${CHANNELS_DVR_ALTERNATES} # Space separated list of alternate Channels DVR servers to choose from in the form hostname:port or ip:port.

in the env vars

CHANNELS_DVR_HOST=192.168.1.4
CHANNELS_DVR_PORT=8089
CHANNELS_DVR_ALTERNATES=192.168.1.4:8189 192.168.1.4:8190 192.168.1.4:8289 192.168.1.4:8389 192.168.1.4:8489

Any action that can run on a server will give you a dropdown list to select the server to run it against.

1 Like

ahh...I must've forgot about that along the way. Thanks guys

1 Like

hey guys, looking at the GitHub installation options, which is the most suitable option for Channels functionality. My DVR is on a macmini. Also is there a particular fork that everyone is using ?

Docker container using Portainer stacks

His github isn't as up to date as the container images
And his Portainer stacks compose includes the halverneus static file server

I would recommend installing docker on the mini, then install the container portainer, then use the portainer gui to install Olivetin using the docker-compose in post #1 adding as a new stack.

This project has come a long way in its 15 month history.
Congratulations @bnhf :clap: 10K+ downloads!
Thanks for creating this swiss army knife for Channels DVR :smile:

2 Likes

I am getting an error when I do the health check.

curl: (6) Could not resolve host: local-server
HTTP Status: 000
Effective URL: http://local-server:8089/

That will fail since on the Mac I think the url needs be localhost:8089
Ah it was in the variables. do I need to recreate the image.

To make changes to the environment variables, stop the stack. Make your changes, and then click the "Update the stack" button in Portainer.

The provided env vars are just examples -- you need to enter the appropriate values for your setup.

1 Like

Honestly wasnt sure if I was going to get there. Thank you so much!
have my first YouTube streams back!

5 Likes

Indeed! Around 22K downloads now -- believe it or not. :slight_smile:

3 Likes

Me too