PDA

View Full Version : Subscription hack and logs



mrblack51
06-29-2001, 05:35 PM
By setting the tivo using the servicestate hack, wouldn't we need to add a script that will automatically delete the usage logs? If they are automatically deleted after a certain amount of time, then great, but otherwise, the logs would start piling up pretty quick.

mwsmith824
06-29-2001, 11:34 PM
Should be easy enough to symlink them to /dev/null and then never worry about them again

mrblack51
06-30-2001, 12:09 AM
what is the proper syntax for that call?
will i have to add that call to /etc/rc.d/rc.sysinit to make it stay beyond reboots?
will i have to use chattr to prevent the changes from being overwritten?

I'm using this and a few other projects to try and get my feet wet with linux, so please excuse the newbieness.

stryder
06-30-2001, 12:38 AM
No a symlink is permanent. Unless a Tivo upgrade wipes it out.
ln -s /dev/null <log name>

sir_lunatic
06-30-2001, 11:57 AM
/tvbin/TClient is what runs the daily calls, you could add to this a sub that either deletes the log or rotates it and gzips it. Should be a simple and worth while hack.

We could also set an enviroment variable in rc.sysinit that causes the hack above to preserve logs or rotate logs for easier debugging purposes.

mrblack51
06-30-2001, 01:19 PM
This is not my script, but it looks like it should work in the short term. I would like to see an implementation of the rotating logs script, especially with the possibility of using ethernet on the DTivo.

#/bin/bash

while (1) {

rm /var/tmp/*log
sleep 300

}

dclxvi
07-01-2001, 10:19 AM
Wouldn't:

chattr +i /var/hack/tivoLog.pub.gz

prevent the tivo from uploading updated information?

sir_lunatic
07-02-2001, 10:02 AM
Ok you can try this to rotate logs.

Paths and filenames will have to be checked/changed. Dont have a Tivo in front of me.

You can make this a seperate executable and call it in /tvbin/TClient before it dials out. Or it can be added to the jPag script.

-----Cut here--------

#! /bin/bash
if [ -f /var/log/filename ] ; then
cd /var/log
if [ -f filename.6.gz ] ; then mv -f filename.6.gz filename.7.gz ; fi
if [ -f filename.5.gz ] ; then mv -f filename.5.gz filename.6.gz ; fi
if [ -f filename.4.gz ] ; then mv -f filename.4.gz filename.5.gz ; fi
if [ -f filename.3.gz ] ; then mv -f filename.3.gz filename.4.gz ; fi
if [ -f filename.2.gz ] ; then mv -f filename.2.gz filename.3.gz ; fi
if [ -f filename.1.gz ] ; then mv -f filename.1.gz filename.2.gz ; fi
if [ -f filename.0.gz ] ; then mv -f filename.0.gz filename.1.gz ; fi
cp -pf filename filename.0
touch filename
gzip filename.0
fi