Difference between revisions of "User:Zavex"

From MythTV Official Wiki
Jump to: navigation, search
m
Line 1: Line 1:
[[User:Zavex/Setup]]
+
[[User:Zavex/Setup]]<br/>
[[User:Zavex/Patches]]
+
[[User:Zavex/Patches]]<br/>
 
+
[[User:Zavex/Scripts]]<br/>
Script to set wakeup time (acpi wakeup)
 
<pre>
 
#!/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
 
</pre>
 
 
 
Script to update file sizes in database
 
<pre>
 
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 -
 
</pre>
 

Revision as of 20:42, 31 May 2008

User:Zavex/Setup
User:Zavex/Patches
User:Zavex/Scripts