Hello all.  Long time reader/first time poster.

Following the thread, I remembered I had found a snazzy script some time
back, not sure whom originally created it, but it worked well with 2.x, but
not 3.x.

When I run the script, I get the following error:

MS: 49953000
NOWDATE: 20210131
LOG_NAME: 20210131_LOG
ERROR 1146 (42S02) at line 1: Table 'Rivendell.20210131_LOG' doesn't exist
SQLRESULT: -1

I assume something in the database has changed, I'm not well versed in
SQL.  Any takers, and does this work for others in the power outage
scenario?    I have another variant of this script for initial bootup,
which ensures that rdairplay is running, this one assumes its running
already.

Here below is said script:

#!/bin/bash
#Set RD variables
user="rduser"
pass="letmein"
host="localhost"
db="Rivendell"

#Get the current time
let h=$(date +%-k)*3600000
let m=$(date +%-M)*60000
let s=$(date +%-S)*1000
let ms=$h+$m+$s
echo "MS: "$ms

#Get the current date formatted for the log name you use
NOWDATE=$(date +%Y%m%d)
echo "NOWDATE: "$NOWDATE

#Get the actual log name my logs are 2014_07_14_LOG so change this
LOG_NAME=$NOWDATE"_LOG"
echo "LOG_NAME: "$LOG_NAME

#Get the row count from the DB based on the current time
let SQLRESULT=$(mysql --skip-column-names -u "$user" -p"$pass" -h "$host"
"$db" -e "SELECT COUNT from $LOG_NAME where START_TIME >= $ms LIMIT 1";)-1
echo "SQLRESULT: "$SQLRESULT

#Send the RML command LL to load a log from the specified line
/usr/bin/rmlsend LL\ 1\ $NOWDATE\ $SQLRESULT\!

End of script...

Nick
_______________________________________________
Rivendell-dev mailing list
Rivendell-dev@lists.rivendellaudio.org
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev

Reply via email to