Hi,
Cron entry: Add the following to /hack/etc/crontab to execute the script every day @ 4am. Ensure a blank line remains at the end of the file.
00 04 * * * root reboot
Peter.
Hi,
I've just got my TIVO running closer to normal now, that is if I reboot it every day...otherwise it will freeze or the sound will cut off...
So I was wondering if anyone know how i could set up a cron job for the tivo to reboot say 4 am every morning ?
Thanks, have a good day !
Regards
Arve
It is better to resolve the issue rather rather than try work around it via reboots. The freezing is likely caused by TivoWeb... in which case you should seriously consider either removing the phone.itcl module, or replace it with TivoWebPlus. The sound cutting out is possibly a software issue, if you could provide some information on the setup of your Tivo as well as a dump of the PALMOD messages ("grep PALMOD /var/log/kernel") then that too could be looked into.Originally Posted by arvesolland
This is the third posting I have replied to from a user concerning sound loss... but it seems that nobody is prepared to provide the log entries that would help determine if the issue can be resolved with a software update. If anyone is getting this regularly then I am happy to work through the the issue with them and provide software updates for them to try and resolve or determine what the issue is.
If you do still wish to schedule regular reboots and are worried about rebooting in the middle of a recording and possibly loosing a few minutes of a show, then you could use a script similar to the following rather than the reboot command (I have not tested this so it may need tweaking):Originally Posted by arvesolland
Code:#!/tvbin/tivosh # # safereboot.tcl <age> # # Check if there are recordings active before rebooting # # Can optionally check to see if the system has been up # <age> hours before rebooting. set reboot 1 set db [dbopen] if {$argc > 0} { set age [lindex $argv 0] set uptime [lindex [exec cat /proc/uptime] 0] set uptime [expr int($uptime)] if {$uptime < [expr $age * 3600]} { if {$age > 1} { puts "Tivo has rebooted in the last $age hours, skip reboot" } else { puts "Tivo has rebooted in the last hour, skip reboot" } exit } } ForeachMfsFile fsid name type "/Recording/InProgress" "" { RetryTransaction { set rec [db $db openid $fsid] set state [dbobj $rec get State] if {$state == 3} { set seltype [dbobj $rec get SelectionType] switch $seltype { 0 {# Ignore LiveBuffer recordings} 6 {# Ignore Suggestion recordings} default {set reboot 0} } } } } if {$reboot == 0} { puts "Currently recording, can't reboot" } else { puts "No recordings active, rebooting" exec /tvbin/reboot }
Last edited by thomson; 04-03-2006 at 03:14 PM. Reason: Tweaked the script
I reboot via cron myself at 4am every morning (both my tivos do) no problems whatsoever using this method.
Thought I'd play with the script.Originally Posted by thomson
I get the following error though:
Peter.Code:safereboot.tcl: line 17: syntax error near unexpected token `int($' safereboot.tcl: line 17: ` set uptime [expr int($uptime)]'
Could be a transfer error... with TCL scripts it is best to do a "dos2unix script.tcl; chmod 755 script.tcl" to ensure it is in the correct format. I have also attached the script to avoid any unusual cut and paste errors.Originally Posted by petestrash
I do maintain that there is no need to schedule regular reboots of a TiVo, and I am happy to work through the issues with anyone that wishes to get their system running more reliably.
I just copy and paste into joe. It looked good, though I have had issues pasting scripts into joe before.Originally Posted by thomson
I have just ftp'd your attached file and have the same errors.
Code:[TiVo [p0] /var/hack]# dos2unix safereboot.tcl dos2unix: converting file safereboot.tcl to UNIX format ... [TiVo [p0] /var/hack]# chmod 777 safereboot.tcl [TiVo [p0] /var/hack]# [TiVo [p0] /var/hack]# ls -l safereboot.tcl -rwxrwxrwx 1 0 0 1110 Mar 5 19:27 safereboot.tcl [TiVo [p0] /var/hack]# [TiVo [p0] /var/hack]# sh safereboot.tcl safereboot.tcl: line 16: syntax error near unexpected token `int($' safereboot.tcl: line 16: ` set uptime [expr int($uptime)]' [TiVo [p0] /var/hack]# [TiVo [p0] /var/hack]# cat safereboot.tcl #!/tvbin/tivosh # # safereboot.tcl <age> # # Check if there are recordings active before rebooting # # Can optionally check to see if the system has been up # <age> hours before rebooting. set reboot 1 set db [dbopen] if {$argc > 0} { set age [lindex $argv 0] set uptime [lindex [exec cat /proc/uptime] 0] set uptime [expr int($uptime)] if {$uptime < [expr $age * 3600]} { if {$age > 1} { puts "Tivo has rebooted in the last $age hours, skip reboot" } else { puts "Tivo has rebooted in the last hour, skip reboot" } exit } } ForeachMfsFile fsid name type "/Recording/InProgress" "" { RetryTransaction { set rec [db $db openid $fsid] set state [dbobj $rec get State] if {$state == 3} { set seltype [dbobj $rec get SelectionType] switch $seltype { 0 { # Ignore Live Buffer recordings} 6 { # Ignore Suggestion recordings} default {set reboot 0;} } } } } if {$reboot == 0} { puts "Currently recording, can't reboot" } else { puts "No recordings active, rebooting" exec /tvbin/reboot }[TiVo [p0] /var/hack]#
I don't have any real issues, uptimes are generally 14-30 days.Originally Posted by thomson
freezes only tend to occur after a heavy session catching up on shows where the remote is used excessively. Or when a lot of SP's are modified or added/deleted.
Just thought I'd try it on one unit and see if we still get the occasional freezes.
Peter
This is a TCL script not a Bourne(sh) script. It should be run with the full path or in your case './safereboot.tcl'.Originally Posted by petestrash
Hi Thomson,Originally Posted by thomson
Thanks for your reply.
the sound cutting out is my major problem at the moment, hasn't happened for a couple of days now, but the other day, 80% of recorded shows on that day were without sound
I tried doing a grep PALMOD /var/log/kernel but i dont get anything at the moment, its just a few hours since the morning reboot though....
Im only using a austar STB (QLD) at the moment, no FTA so will any PALMOD errors still show up even though Darren has not modded my box ?
Guess I could set up a cron to dump the grep PALMOD /var/log/kernel into a file just before each reboot to catch it all.....
I really appreciate your help thompson, as I would love to resolve the issues as well, not just work around them
Thanks,
Have a good day !
Regards
Arve
Bookmarks