Channels WebUI Slow / Unresponsive in Unraid

Just moved from Win11 to Unraid - when I access the WebUI and perform an action such as deleting 1 item out of the schedule that was a missed recording, then the WebUI becomes unresponsive for a few minutes and a couple of my disks spin up in the array - it eventually comes back - I have a 4TB cache that should prevent disk spinup, but perhaps I need to move some of the channels folders to cache only? - Unraid seems to have recorded several shows at the same time with no issues, but the WebUI is painfully slow - any tips? Is the Unraid Connect plugin still causing issues?

Lock every folder that does not contain media to your cache. That's very little storage though it may be a lot of tiny files. You will still have to wait for the spinners when you play a video or beginn to record on. It may be necessary to start your recordings 10 seconds or 30 seconds early.

How do you lock all of the non-media folders to the cache? Do you mean splitting the "dvr" share for channels such that the folders TV, Movies and Playon would be on the array, but everything else would be on the cache? As far as I can tell, Unraid only lets me do this on the share top level and unfortunately, channels puts everything under the same dvr folder

If you have a large library on recordings that will not fit on an affordable size SSD, then you need to take advantage of channels ability to have multiple storage paths. Place the first storage path on your cache or SDD and your long term storage on an additional path and this will be on hard drive(s). You can also adjust your scan frequency as needed. All new recordings will go to the first path listed. You will have to move ones that you want to hold onto for a very long time.

OK thanks - I now see the storage paths under settings - never used that before...

1 Like

Does anyone have a script that will move files older than a certain number of days from one folder to another while copying the subfolder structure?
I am looking to move files from /mnt/user/dvr/TV (TV recordings folder) to /mnt/user/dvr-archive/TV -
so far the closest I can get is this:

find /mnt/user/dvr/TV -type f -mtime +90 -exec mv "{}" /mnt/user/dvr-archive/TV \;

The problem with the above is that it doesn't copy the folder structure and the files all end up in /mnt/user/dvr-archive/TV
Note: I want to use 'mv' rather than 'rsync' to avoid copying then deleting the file

AI provided me with this script - but it doesn't work:

#!/bin/bash

source_dir="/mnt/user/backups/test"
dest_dir="/mnt/user/archive/test"
age_threshold=180

# Check if destination directory exists, create it if not
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
fi

# Find files older than the age threshold
find "$source_dir" -type f -mtime +"$age_threshold" -print0 | while IFS= read -r -d $'\0' file; do
# Get the relative path of the file from the source directory
relative_path="${file#"$source_dir"/}"

# Construct the destination path, preserving the directory structure
dest_path="$dest_dir/$relative_path"

# Create the necessary directories in the destination path
mkdir -p "$(dirname "$dest_path")"

# Move the file to the destination path
mv "$file" "$dest_path"
done

Output:
bash: ./moveit.sh: cannot execute: required file not found
Anyone know what the problem is?

I am using rsync but it moves the file just fine for me

find /media/channelsdvr/2TB/DVR/TV -mtime +75 -printf %P\\0|rsync --remove-source-files -at -P --files-from=- --from0 /media/channelsdvr/2TB/DVR/TV/ /media/channelsdvr/8TB/DVR/TV/

To add to this I have the script delete orphaned empty directories after I copy them over, just becuase it bothers my OCD

#Clean up orphaned empty dirs
find /media/channelsdvr/2TB/DVR/TV/ -empty -type d -delete
find /media/channelsdvr/2TB/DVR/Movies/ -empty -type d -delete

Thanks - I got the mv script to work and used your cleanup - the problem with the mv script is that the file was saved in MS-DOS format, not unix - I am going to paste the entire thing below in case anyone is interested - NOTE: comment delimeter modified due to formatting issue in post

#!/bin/bash

source_dir="/mnt/user/backups/test"
dest_dir="/mnt/user/archive/test"
age_threshold=180

# Check if destination directory exists, create it if not
if [ ! -d "$dest_dir" ]; then
mkdir -p "$dest_dir"
fi

# Find files older than the age threshold
find "$source_dir" -type f -mtime +"$age_threshold" -print0 | while IFS= read -r -d $'\0' file; do
# Get the relative path of the file from the source directory
relative_path="${file#"$source_dir"/}"

# Construct the destination path, preserving the directory structure
dest_path="$dest_dir/$relative_path"

# Create the necessary directories in the destination path
mkdir -p "$(dirname "$dest_path")"

# Move the file to the destination path
mv "$file" "$dest_path"
done

#remove empty folders from the source directory
find "$source_dir/" -empty -type d -delete

Update: there is a difference between using rsync and mv when trying to archive old recordings from a storage path in a cache drive/NVMe to a storage path only on the array/hdds -

mv will keep the recordings on the NVMe, and the mover will move them later when it runs,
rsync will move them to the hdds directly

I ended up going with the following script based on slampman's script

#!/bin/bash
src="/mnt/user/dvr/TV"
dst="/mnt/user/dvr-archive/TV"
age=30

find "$src/" -type f -mtime +"$age" -printf %P\0 | rsync --remove-source-files -avPR -X --files-from=- --from0 "$src/" "$dst/"

#Clean up orphaned empty dirs
find "$src/" -empty -type d -delete

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.