Hi All,
I was playing with the sample script here, and keep getting a command not found error on ForeachMfsfile...
Where should that be?
Thanks!
So, there is no file that gets run on a daily basis in 3.1?
All I was going to do was add to the script that already gets run on a daily basis and if the date were to equal 3 or 5 or 10 etc.. then I would have it run the reboot script.
I did this to the TClient-lib file in 2.5.2 and had it set to where if the date was 14 or 28 then it would run a script I made to delete the history.
I am just not sure what, if any, files get run on v3.1 on a daily basis that I could edit and add to like I did in v2.5.2.
Hi All,
I was playing with the sample script here, and keep getting a command not found error on ForeachMfsfile...
Where should that be?
Thanks!
Even I donated because this place has saved me more time and money than I could even count...
Does anyone have a list (or can point me to the list) of all the SelectionTypes? Just trying to cover all my bases on when I want it to reboot. Silverdude posted this piece of code:Originally posted by rc3105
just add/remove seltype matches to suit the particular use
Wishlist, Season Pass, Suggestion, and Manual Recording are labeled. Can anyone complete the list?Code:switch $seltype { # 15 { set reboot 0 ;puts "15 - " } # 14 { set reboot 0 ;puts "14 - " } 13 { set reboot 0 ;puts "13 - WishList" } # 12 { set reboot 0 ;puts "12 - " } # 11 { set reboot 0 ;puts "11 - " } # 10 { set reboot 0 ;puts "10 - " } 9 { set reboot 0 ;puts "9 - Seasone Pass" } # 8 { set reboot 0 ;puts "8 - " } # 7 { set reboot 0 ;puts "7 - " } 6 { set reboot 0 ;puts "6 - Suggestion" } # 5 { set reboot 0 ;puts "5 - " } # 4 ( set reboot 0 ;puts "4 - " } # 3 { set reboot 0 ;puts "3 - Manual Recording" } # 2 { set reboot 0 ;puts "2 - " } # 1 { set reboot 0 ;puts "1 - " } # default { set reboot 0 ;puts "Default" } }
Thanks!
Last edited by gb498; 11-14-2003 at 02:50 AM.
well, lets see...what other things the tivo records
service data downloads
starz video on demand
clips for showcases?
Step one: search button!
Silly Wabbit, guides are for kids
poke though tivoweb, the display SelectionTypes (and many many other things) are defined in there
---
Give a man a fish and he will eat for a day. Teach a man to fish and he will sit in a boat all day and drink beer
Ahhh, excellent suggestion. I will check it out and post my findings. Thanks.Originally posted by rc3105
poke though tivoweb, the display SelectionTypes (and many many other things) are defined in there
OK, for anyone else who might be interested, here are all the different SelectionTypes for a recording, as taken from Tivoweb module ui.itcl:
1 Show Recommendation
2 Package Recommendation
3 By Name
4 By Channel
5 Manual
6 Suggestion
7 Fuzzy Package
8 Bookmark
9 Season Pass
10 Manual Season Pass
11 Guide
12 IPreview
13 WishListPass
14 Extended
15 ManualExtended
16 CaptureRequest
17 DailyData
I don't know what some of them are, but it seems to me that one might also want to reboot on 1,2,7,8,12,14,15,16,17. But again I'm not sure exactly what these are, they just don't sound like critical, user-initiated recordings.
Hi All,
I asked once before, but never got a response...
One last try
I installed a fresh 3.1 image, and have not been able to use the scripts posted in this thread.
I always get an error on ForeachMfsfile, saying command not found...
Can anyone else on 3.1 help me?
Thanks!
David
Even I donated because this place has saved me more time and money than I could even count...
Trying to run script:
#!/tvbin/tivosh
# safe_reboot.tcl-
# reboots ONLY if there aren't any suggestion recordings in progress
set db [dbopen] ;set reboot 1
set mfspath /Recording/InProgress
ForeachMfsFile fsid name type "$mfspath" "" {
RetryTransaction {
set rec [db $db openid $fsid]
set state [dbobj $rec get State]
switch $state {
3 {
set seltype [dbobj $rec get SelectionType]
switch $seltype {
6 { #puts "suggestion - reboot away" }
0 { #puts "live buffer?" }
default { set reboot 0 }
}
}
default { }
}
}
}
if { $reboot } { puts "rebooting" ;exec /tvbin/reboot }
puts "busy, can't reboot"
Output:
tivo:/var/hack/bin$ . /var/hack/bin/safe_reboot.tcl
bash: ForeachMfsFile: command not found
bash: RetryTransaction: command not found
bash: switch: command not found
bash: 3: command not found
bash: switch: command not found
bash: 6: command not found
bash: 0: command not found
bash: default: command not found
: command not found
: command not found
bash: default: command not found
: command not found
: command not found
: command not found
bash: /var/hack/bin/safe_reboot.tcl: line 25: syntax error: unexpected end of file
Trying this on a HR10-250 6.3e sodtware
#!/tvbin/tivosh
#
set db [dbopen]
set reboot 1
set mfspath /Recording/InProgress
ForeachMfsFile fsid name type "$mfspath" "" {
RetryTransaction {
set rec [db $db openid $fsid]
set state [dbobj $rec get State]
switch $state {
3 {
set seltype [dbobj $rec get SelectionType]
switch $seltype {
13 { set reboot 0 ; puts "13 - WishList" }
9 { set reboot 0 ; puts "9 - Seasone Pass" }
6 { set reboot 1 ; puts "6 - Suggestion" }
3 { set reboot 0 ; puts "3 - Manual Recording" }
}
}
default { }
}
}
}
if { $reboot == 0 } {
puts "busy, can't reboot"
# no reboot
}
if { $reboot == 1 } {
puts "rebooting"
# reboot tivo here
}
IT seems that even if its a manual record or season pass it shows $state to be 3
not tested for suggestion or wishlist yet but I bet they will all be State 3 and Selection type 3
I was trying to create a restart only if the tivo is NOT recording a 'manual recording', 'season pass', 'wishlist' or 'playing a recording'.
This works. All I need todo is figure out if the tivo is playing a recording or not.
This will check to see if the tivo is recording a season pass / manual record / wishlist and if so not to reboot
who cares about sugestions
#!/tvbin/tivosh
#
set db [dbopen]
set count 0
set mfspath /Recording/InProgress
ForeachMfsFile fsid name type "$mfspath" "" {
RetryTransaction {
set rec [db $db openid $fsid]
set indexpath [dbobj $rec get IndexPath]
#puts "."
#puts "."
#puts "show $indexpath "
set rebrecord 1
set rebcache 0
set rebsuggest 0
# 1st /Recording/InProgress/
if {![string match "*/Recording/InProgress/*" $indexpath]} {
# puts "not a /Recording/InProgress/ reboot"
set rebrecord 0
} else {
#puts "is /Recording/InProgress/ DO NOT REBOOT"
set rebrecord 0
}
# 2nd /Recording/LiveCache/
if {![string match "*/Recording/LiveCache/*" $indexpath]} {
# puts "not a /Recording/LiveCache/ ok to reboot"
# set rebcache 1
} else {
#puts "is a /Recording/LiveCache/ ok to reboot"
set rebcache 1
}
# 3rd SUGGESTION
if {![string match "*SUGGESTION*" $indexpath]} {
# puts "not a SUGGESTION ok to reboot"
# set rebsuggest 1
} else {
#puts "is SUGGESTION ok to reboot"
set rebsuggest 1
}
if { $rebrecord == 0 } {
if { $rebcache == 1 } {
# puts "can reboot 46"
} else {
if { $rebsuggest == 1 } {
# puts "can reboot 50"
} else {
# puts "busy cant reboot 53"
set count 1
}
}
} else {
#puts "busy cant reboot 58"
set count 1
}
if { $count == 1 } {
# puts "NO REBOOT $count"
} else {
# puts "REBOOT $count"
}
}
}
if { $count == 1 } {
puts "busy, can't reboot"
#dont reboot
} else {
puts "rebooting"
#reboot
}