Installing on Linux - Separate Program and File Directories

I'm running Channels on a MacMini and I want to switch it over to a Debian Linux system. I've read the information here about setting up Channels on Linux. From what I see there, it looks like the program files and the data files are all in one directory tree. Is that correct? I want the video files to be stored on a hard drive I'm using as a Samba share and, if possible, I'd like to keep the program in /usr/local/channels-dvr and either keep all the data in /share/DVR/Channels or keep the non-video data files in /usr/local/channels-dvr and keep the video files in /share/DVR.

Is this possible?

And if Channels, under Linux, puts all the data, video, and program files in one directory tree, like /usr/local/channels-dvr, can I use a softlink from that directory tree to the directory where I want to put the video files?

You can symlink data if you want, but the server will automatically backup the important files (*.db) to the video storage drive on a regular basis. These can be use to restore a new install via http://x:8089/restore

So there is no problem with telling the Linux version to store the DVR files in a location away from the program files, just like when I used Chrome and set up Channels on my Mac?

If it's backing up the files to my storage drive, then I might as well keep the data there anyway.

Let me make sure what I'm doing will work:

  1. Copy all the files on my Mac, in /Videos/Channels (that's the directory I picked as my DVR directory when setting up Channels with Chrome, on the setting page) to /share/DVR/Channels on my Linux system.
  2. Install Channels on Linux with the directions here
  3. Use Chrome to connect to port 8089/restore on my Linux system - and I take it that's when I can tell it that the DVR folder is in /share/ DVR/Channels?

I'm not nearly as worried about DB files being on the share drive as I am about executables being there.

Also, one other question: When I set this up, and log in with my username, is there a problem with two instances of Channels using my subscription for a few days, while I get everything changed over? Or am I limited to only one instance of Channels using my subscription at a time?

That's exactly how I run Channels. I have it installed to /usr/lib/channels-dvr (and the only things in that directory are the program files in date-named directories, and a symlink latest to the current version); I use /var/lib/channels-dvr as my data directory, but it's not called that, and there is no directory called data; my recordings and other DVR files are in /srv/channels-dvr, which is a bind-mount to a directory on an external drive.

Then, I run Channels with a systemd service unit; here's the relevant portion:

[Service]
Type=simple
User=channels-dvr
Group=channels-dvr
WorkingDirectory=/var/lib/channels-dvr
ExecStart=/bin/sh -c 'exec /usr/lib/channels-dvr/latest/channels-dvr >> /var/lib/channels-dvr/channels-dvr.log 2>&1'
Restart=always

I haven't had any troubles with this setup.

Doesn't the setup script from the link I referenced earlier automatically setup Channels to start automatically?

Yes, Channels' setup script will do that. But it will create the data directory, too.

Perhaps I'm just pedantic about wanting separation between system and state directories. I'm not personally a fan of using provided installation scripts from outside my distro's packages because they rarely adhere to these principles of separation.

I agree. Whenever I'm using any Linux distro, I strongly prefer installing things with packages from distro repositories. I also am big on keeping program files and data files separate. That makes it easier to deal with backups, sharing, and using data. (Programs are usually easy to restore unless they have a tricky config file or something like that.)

1 Like