This is an example of a very basic PVR script to schedule recordings on the HDHomeRun Plus (HDTC-2US). Scheduling is accomplished via a cron job which calls the script to record the HDHomeRun stream to a NAS where my Plex server will pick it up (to be Chromecasted at a later time.)
The below example shows an entry in /etc/crontab which calls the script and passes the Program name, channel and legth:
00 16 * * 1-5 root /home/marc/scripts/tv 43 60 The.Dr.Oz.Show
Next the script runs with the given variables:
#!/bin/bash channel=$1 length=$(($2*60)) programname=$3 curl -m $length -o /u/video/Recordings/$programname/$programname-$(date +%Y-%m-%d).mp4 http://192.168.10.247:5004/auto/v$channel?transcode=mobile