User:Zavex
From MythTV Official Wiki
User:Zavex/Setup User:Zavex/Patches
Script to set wakeup time (acpi wakeup)
#!/bin/bash LOG=/myth/scripts/setwakeuptime.log echo "----------------------------------------" >> $LOG date >> $LOG echo "args: '$0' '$1' '$2' '$3' " >> $LOG #convert to UTC stamp_file=/tmp/timestamp echo $2 | sed "s/T/ /" > $stamp_file # Read the date in the locale time format and add the time-zone info to the stamp_file datum=$(/bin/date -f $stamp_file +%F\ %T\ %z) echo $datum > $stamp_file # reinterpret this in utc and write to alarm utcdatum=$(/bin/date -u -f $stamp_file +%F\ %T) echo "Next wakeup Time (UTC): $utcdatum" echo "Next wakeup Time (UTC): $utcdatum" >> $LOG rm -f $stamp_file echo $utcdatum >/proc/acpi/alarm echo "----------------------------------------" >> $LOG
Script to update file sizes in database
VIDEODIR=/myth/tv cd $VIDEODIR for FILENAME in $( ls *.mpg ); do #echo $FILENAME new size = $(ls -lL $VIDEODIR/$FILENAME | awk '{print $5}'); #done cat << EOF | mysql -u mythtv -p<password> mythconverg UPDATE recorded SET filesize = $(ls -lL $VIDEODIR/$FILENAME | awk '{print $5}') WHERE basename = '$FILENAME'; EOF done cd -