SpecifiedDaysZA
From TivoZA
The below script allows you to specify on which days of the week you would like the TiVo to perform a daily call. One of the other advantages of the script is that it will check if the call succeeded and if not it will try to perform the daily call again, this is done a maximum of 3 times per the days its allowed to connect. Although when following the below instructions the script executes at 12am daily, when a real call is made it waits a random amount of time (up to 4 hours) before performing the call so that a bottleneck doesn't occur by all users accessing the server at the same time.
First thing you need to do is download a copy of 'SpecifiedDaysZA.tcl (http://tivoza.nanfo.com/downloads/SpecifiedDaysZA.tcl)' to your TiVo. To do this, either download the file and FTP it to your TiVo's '/hack/bin' directory or if your TiVo has network access you can download it directly as follows:
wget tivoza.nanfo.com/downloads/SpecifiedDaysZA.tcl -P /hack/bin
Once the file has been downloaded you need to give rights to execute, you can do this from the telnet prompt by typing:
chmod 755 /hack/bin/SpecifiedDaysZA.tcl
By default the TiVo will perform a call every day, the 'SpecifiedDaysZA.tcl' will continue to perform calls but only on the days you specify. On the days you don't want the TiVo to call in, it will fake a call attempt.
To make sure the script gets executed every day, you need to create a cron job. This is done by modifying the '/var/hack/etc/crontab' file. A quick way to add the above line to the '/var/hack/etc/crontab' file, is to type the following:
echo -e "\n00 00 * * * /hack/bin/SpecifiedDaysZA.tcl 25 >> /var/log/specifiedDaysZA.log 2>&1 &" >> /var/hack/etc/crontab
The above will add the following line to the end of the '/var/hack/etc/crontab' file:
00 00 * * * /hack/bin/SpecifiedDaysZA.tcl 25 >> /var/log/specifiedDaysZA.log 2>&1 &
The first '00' indicates the minutes and the second '00' indicates the hours at what time the script should be executed. Using the '00 00' combination means that the script will be executed at 12am daily. If you were to use '30 02' the script would be executes at 2:30am daily.
The remaining '* * *' indicate the day of month, month & day of week that the script should be executed. We need to have the script executed daily so the '* * *' will mean the other values are ignored.
The next part of the cron job indicates the script that should be executed, in this case '/hack/bin/SpecifiedDaysZA.tcl'.
This is followed by its parameter list, the value '25' indicates what days of the week a daily call is allowed to be made. You can use any combination from 0 (Sunday) to 6 (Saturday) but make sure there are no spaces between the values. The guide data is currently generated on Mondays and Thursdays so to pick up the latest updates, it's best to set the daily call to be performed on Tuesdays and Fridays, i.e. the param should be set to '25'
The last part of the cron line ">> /var/log/specifiedDaysZA.log 2>&1 &" sends any output from the 'SpecifiedDaysZA.tcl' to the file '/var/log/specifiedDaysZA.log'. This can be quite useful as it lists the time and date when the script was executed, whether it was a real or fake call and whether or not the call succeeded. You can view the log from TiVoWebPlus by clicking on the Logs menu and the selecting the file 'specifiedDaysZA.log'. The log file size shouldn't grow to quickly but from time to time it may be worth clearing it to make viewing easier.


