PDA

View Full Version : Guide/Updates logging



khmann
07-06-2001, 12:31 PM
Greetings all. I wrote the following bash script to create duplicates of all files on my /var filesystem, for using when my 1.3 Phillips TiVo is updating guide data. This slows things down terribly, but it does seem to work- I just got my local slices and some 'removeDbsObject' script.

Update- I have since used this script to grab a copy of the 2.0.1 upgrade files as they were downloaded - but 'ya gotta have "export GZIP=-f' in your rc.sysinit. really. it's important.

What it does is recursively scan the filesystem and create hard links to files (before they're deleted...). The advantage to mirroring files this way is that the copies take up zero effective space until the original is deleted.

The /var filesystem is duplicated under /var/.hl/var. The only 'gotcha' is that if a file (once mirrored in this fashion) is deleted and then re-created, the mirror (/var/.hl/var/...) will still be the old file. Because of this, you may wish to periodically rename or remove /var/.hl while the script is not running.

*** UPDATE 07/09/01 ***
It is vitally important to add "export GZIP=-f" as one of the first commands in /etc/rc.d/rc.sysinit. If you do not, the tivo will not be able to work with any data that it downloads which is GZIP'd - this includes the 2.0.1 update, and slice data. Trust me, it's important.


Hope this helps someone....

-khmann


#!/bin/bash
parent=/var
echo "PARENT is $parent"
if [ ! -d "$parent/.hl" ]; then
echo "creating $parent/.hl"
mkdir "$parent/.hl"
fi
if [ ! -d "$parent/.hl$parent" ]; then
echo "creating $parent/.hl$parent"
mkdir "$parent/.hl$parent"
fi


hldir() {
for i in $1/* ; do
if [ -e "$i" ]; then # if source really exists
if [ ! -e "$parent/.hl$i" ]; then # dest no exist
if [ -L "$i" ]; then
if [ ! -L "$parent/.hl$i" ] ; then # source is symlink
echo "dup symlink $i"
cp -a "$i" "$parent/.hl$i" # copy the symlink
fi
else
if [ -d "$i" ]; then
echo "new dirsync $i"
mkdir "$parent/.hl$i" # make the directory
else
echo "hardlinking $i"
/bin/ln "$i" "$parent/.hl$i" # create a hardlink
fi
fi
fi
if [ -d "$i" ] && [ ! -L "$i" ] ; then
hldir "$i" # check the subdir also
fi
fi
done
}

while [ true ] ; do
hldir "$parent"
sleep 5
done
~

Tictoc
07-06-2001, 03:21 PM
Hi khmann. Great script.

I am looking for a way to automatically get a slice file everytime tivo updates their guide, and I think this script can do just that.

The only thing that missing is how to start the script in the beginning of tivo dialup and terminate it in the end automatically, so I don't have to monitor tivo everytime it dials. Can anyone give me a direction to do this?


Thanks in advance.

surgeon
07-08-2001, 12:31 PM
Originally posted by khmann
Greetings all. I wrote the following bash script to create duplicates of all files on my /var filesystem, for using when my 1.3 Phillips TiVo is updating guide data. This slows things down terribly, but it does seem to work- I just got my local slices and some 'removeDbsObject' script.
~

I thought that the only files you would need to offload to another (unsubscribed) TiVo would be the slice files created in the '/var/packages' dir??? Where were the 'removeDbsObject' script files located??? Did you discover how they are updating the call-in date by any chance???

khmann
07-09-2001, 12:28 PM
Other than the slightly opressive CPU load, there's no reason this script can't run every boot from /etc/rc.d/rc.sysinit. I've only had my TiVo for 1 week so I haven't gotten much farther than this. I should also point out that I've only tested this under 1.3.

'removeDbsObject' appears during the Guided Setup, and appears to delete any "headend information" - ie your local channel line up, prior to loading a new headend slice. I believe it appeared in /var/packages. Check out /var/log/http and /var/log/tclient. My 1.3 Phillips also grabbed some sort of 'irdb-75.slice.gz' update.

Other things of interest appear in /var/tmp/unbundled. Specifically .skey files, which I believe may be used to decrypt the whatever.slice.bnd files that actually get downloaded. Some interesting files may also appear in /var/persist, if you create that directory.

If you contemplate using this, please see the (updated) note about GZIP=-f at the start of this thread. Without that, gzip operations won't complete, and the log files show very specific errors about it. TiVo will know what you're doing.

I should note that I will not be able to perform any furthur testing on this script at this time. It worked great for me under 1.3, and did allow me to save the install files for 2.0.1 along with some headend slices.

Anyway, I am not subscribed to TiVo at this time. Until I am able to get my big dish/4DTV setup online, I will not be subscribing and my phone line will remain unplugged. Because I have the upmost respect for TiVo, and strong ethics :), I will not allow my box to make any furthur calls to TiVo because I don't want to cost them any money or otherwise irritate them.

I used my one week free trial to get some slices and test data, along with the 2.0.1 update. Not bad since I'd never seen a TiVo before :). Once I resolve my big-dish issue, I intend to subscribe.

I am going to start work on a C-Band/4DTV middleware app soon. Will keep everyone informed... If anyone else has done work on this, please let me know.

-khmann

mpauley
12-15-2002, 03:25 PM
Has anyone else tried to use this? I have set everything up and have the hardlinked files, just not really sure of everything to do.