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

Checking your OliveTin installation...
(extended_check=false)

----------------------------------------

Checking that your selected Channels DVR server (192.168.1.120:8089) is reachable by URL:
HTTP Status: 200 indicates success...

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1276  100  1276    0     0  1246k      0 --:--:-- --:--:-- --:--:-- 1246k
HTTP Status: 200
Effective URL: http://192.168.1.120:8089/

----------------------------------------

Checking that your selected Channels DVR server's data files (/mnt/192.168.1.120-8089) are accessible:
Folders with the names Database, Images, Imports, Logs, Movies, Streaming and TV should be visible...

total 0
drwxr-xr-x 6 root root 120 Nov  2 16:02 .
drwxr-xr-x 1 root root  82 Nov  3 10:20 ..
drwxr-xr-x 9 root root 180 Nov  2 18:18 Database
drwxr-xr-x 3 root root  60 Nov  2 16:02 Images
drwxr-xr-x 5 root root 100 Nov  2 16:02 Imports
drwxr-xr-x 2 root root  40 Nov  2 16:02 Streaming

----------------------------------------

Checking that your selected Channels DVR server's log files (/mnt/192.168.1.120-8089_logs) are accessible:
Folders with the names data and latest should be visible...

total 0
drwxr-xr-x 5 root root 120 Nov  2 17:05 .
drwxr-xr-x 1 root root  82 Nov  3 10:20 ..
drwxr-xr-x 2 root root 160 Nov  2 15:38 2024.09.10.2115
drwxr-xr-x 2 root root 200 Nov  2 17:05 2024.11.02.1901
drwxr-xr-x 4 root root 220 Nov  2 17:10 data
lrwxrwxrwx 1 root root  15 Nov  2 17:05 latest -> 2024.11.02.1901

----------------------------------------

Here's a list of your current OliveTin-related settings:

HOSTNAME=olivetin
CHANNELS_DVR=192.168.1.120:8089
CHANNELS_DVR_ALTERNATES=
CHANNELS_CLIENTS=Living Room Apple TV  iPad  iPhone
ALERT_SMTP_SERVER=smtp.gmail.com:587
ALERT_EMAIL_FROM=[Redacted]@gmail.com
ALERT_EMAIL_PASS=[Redacted]
ALERT_EMAIL_TO=[Redacted]@gmail.com
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
PORTAINER_TOKEN=[Redacted]
PORTAINER_HOST=192.168.1.120

----------------------------------------

Here's the contents of /etc/resolv.conf from inside the container:

search tail[Redacted].ts.net
nameserver 127.0.0.11
options ndots:0

----------------------------------------

Here's the contents of /etc/hosts from inside the container:

127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
ff00::0	ip6-mcastprefix
ff02::1	ip6-allnodes
ff02::2	ip6-allrouters
172.26.0.3	olivetin

Things are starting to look pretty good.

Your CHANNELS_CLIENTS value looks suspicious though. Are you sure these are the correct hostnames for each of the devices you have running a CDVR client app? Actually, I can answer that, as LAN hostnames never have spaces in them.

If you don't know how to figure out the hostnames, simply use the IP addresses for each of those client devices.

Those are all the devices I have a channels client app on. It is what channels reports them as in its interface as well.

Those are the causal names that Channels DVR uses internally. What we're looking for here are either the LAN hostnames or IP addresses for each Channels client.

Based on this screenshot, use 192.168.1.144 and 192.168.1.116 separated by a single space:

CHANNELS_CLIENTS=192.168.1.144 192.168.1.116

I have a new issue that I know is out of the scope of this thread/app but you seem pretty knowledgeable and I wondered if you can point me in a direction that might explain why it is happening. I understand if I should start a separate thread.
I restarted my Unraid server and every time it reboots (I tried it several times) my channels server is taking me to this page:

I then just do a restore and select the database and all is good, but I know this shouldn't be happening. Any ideas?

I wonder if Unraid is allowing you to create a directory called /data, where the /data/channels-dvr program data is stored. Many NAS operating systems restrict where you can create directories.

The behavior you're describing suggests that /data/channels-dvr isn't being created as a persistent directory, so you lose that data on reboot.

You'll probably need to choose a different "parent" directory for channels-dvr in a location that's writable.

Interesting. It looks like that is exactly what is happening. Here is the setup as per the docker UI in Unraid:

Per the setup Docs on the Channels website it should be like this:

Because of my lack of full understanding of the directory hierarchy in linux/docker/Unraid, I must have created it incorrectly when I initially setup channels. Ugh! Now I have to see if I can figure out how to change this without screwing something up royally. lol

I think I would use /mnt/user as the value for HOST_DIR in your Channels stack. That way, your program data will be stored under /mnt/user/channels-dvr. And, we know /mnt/user is writable.

1 Like

Ok, that seems to have done the trick. I restarted Unraid just to test and all looks fine now.

By the way, do you have a "Buy Me a Coffee" or some such type link where I can donate something to you for all your help?

Woohoo! OliveTin-for-Channels skips merrily past the 20,000 download mark.

Many thanks once again to everyone that's contributed to this project with scripts, testing, reporting issues and just generally positive attitudes.

1 Like

@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