SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-02-2007, 11:38 AM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
What Is Currently Recording Script

Hello folks.

Any of you know, or have a script handy to find out what shows are currently being recorded in SageTV?

What I am looking for is a SIMPLE script that will report back what if any recordings are currently in progress and the file they are producing.

Something like a dos script than when ran, it will report back:

Tunner #1: <nothing>
Tunner #2: E:\Movies\My-favorite-martian-1234567890-0

Or if not withing SageTV, any way with WinTV-150 PVRs?
Reply With Quote
  #2  
Old 02-02-2007, 11:55 AM
gplasky's Avatar
gplasky gplasky is offline
SageTVaholic
 
Join Date: Jul 2003
Location: Howell, MI
Posts: 9,203
nielm's webserver gives you that info. And it produces xml and rss feeds you can get from it.

Gerry
__________________
Big Gerr
_______
Server - WHS 2011: Sage 7.1.9 - 1 x HD Prime and 2 x HDHomeRun - Intel Atom D525 1.6 GHz, Acer Easystore, RAM 4 GB, 4 x 2TB hotswap drives, 1 x 2TB USB ext Clients: 2 x PC Clients, 1 x HD300, 2 x HD-200, 1 x HD-100 DEV Client: Win 7 Ultimate 64 bit - AMD 64 x2 6000+, Gigabyte GA-MA790GP-DS4H MB, RAM 4GB, HD OS:500GB, DATA:1 x 500GB, Pace RGN STB.
Reply With Quote
  #3  
Old 02-02-2007, 12:03 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Quote:
Originally Posted by gplasky
nielm's webserver gives you that info. And it produces xml and rss feeds you can get from it.

Gerry
Cool, now, is there a SIMPLE way of doing this via a DOS .bat file script?

I have his web setup and it's great, but do not know how to do it via a script.
Reply With Quote
  #4  
Old 02-02-2007, 12:38 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Some info in this thread o how to use lynx to get text output from the webserver. Some more info in the wiki on how to use lynx with dos's find.

Also see the external status monitor plugin which can work with DOS telnet to get plain text results which may be more useful for you.

(keep on refreshing if you get 'database is locked' messages from the www.sage-community.org site)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #5  
Old 02-02-2007, 01:11 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Quote:
Originally Posted by nielm
Some info in this thread o how to use lynx to get text output from the webserver. Some more info in the wiki on how to use lynx with dos's find.

Also see the external status monitor plugin which can work with DOS telnet to get plain text results which may be more useful for you.

(keep on refreshing if you get 'database is locked' messages from the www.sage-community.org site)
Cool thanks for the options.

Now, if I have your Web server setup, which of these options in your opinion would be the most SIMPLE ONE to use to find what is currently recording and start SA (ShowAnalyzer)?
Reply With Quote
  #6  
Old 02-02-2007, 01:31 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
This is what DirMon was created for by the way

I have no idea how your script will work so here is a starting point
To start SA, you probably want the filenames that are being recorded, so the webserver's XML output would be best (as it includes filenames)
Code:
C:\lynx\>lynx -source -auth=User:Pass "http://mediaserver:8080/sage/Home?xml=currrecording" | find "filePath"
returns
Code:
<segment duration="207" filePath="\\mediaserver\sage\Sage-Video\ShowName-EpisodeName-2704882-0.mpg" startTime="2007-02-02T19:22:59.38Z"/>
which then needs a bit more parsing to get a simple filename...

If your script can read XML directly, take the lynx output and ignore the find. See the links to the other posts on where to find lynx
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #7  
Old 02-02-2007, 01:56 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
That's very helpful, thanks.

The reason I don't want to use DirMon2, is that I have 6 drives setup to spin-down after 10 minutes of non-use.

DirMon2 keeps my 6 drives from sleeping every time it has to go out and check for new recordings. If I tell DirMon2 to wait a long time between checks, then new recordings don't get SA on them until DirMon2 runs again.

Now, if I can get a SIMPLE script that will see what is currently recording, then it could launch SA. This script could be ran from Windows scheduler say every 5 minutes. This will wake up my C: drive, but that's much better than waking up 6 other drives as well as C: with DirMon2.

I am trying to see if John who wrote the STV for ComSkip Import can setup his code so that it has an option to launch an application when a recording is selected for playback and there is no corresponding .edl, .txt, etc files associated with that recording.

The best option of all, would be if SageTV had pre-processing and post-procession options to launch applications with new recordings. I think GVPRV has a post processing option and people use it to launch SA once a show is done recording.
Reply With Quote
  #8  
Old 02-03-2007, 07:47 AM
amg amg is offline
Sage Advanced User
 
Join Date: Jan 2005
Posts: 161
Are most of your recordings made during "prime-time" or some other block of time? If they are you should be able to set a "black-out" period in dirmon to exclude processing during these non-peak hours.
__________________
unRaid Server:Quad-Core Xenon, 20 GB Ram, openDCT/sageTV Dockers, HDHR,HDHR Prime
Network Encoder:Dell Inspiron 1000 Laptop, 512MB Ram, Windows XP, HDPVR
Reply With Quote
  #9  
Old 02-03-2007, 08:38 AM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Quote:
Originally Posted by joe123
The reason I don't want to use DirMon2, is that I have 6 drives setup to spin-down after 10 minutes of non-use.

DirMon2 keeps my 6 drives from sleeping every time it has to go out and check for new recordings. If I tell DirMon2 to wait a long time between checks, then new recordings don't get SA on them until DirMon2 runs again.
Have you measured the amount of time between spin ups with Dirmon2 disabled? Windows has always caused my drives to spin up often enough that I've decided it's not worth it to have them spin down at all. I followed all the guides I could find on how to prevent the drives from spinning up and never had any luck.
Reply With Quote
  #10  
Old 02-03-2007, 12:46 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Quote:
Originally Posted by blade
Have you measured the amount of time between spin ups with Dirmon2 disabled? Windows has always caused my drives to spin up often enough that I've decided it's not worth it to have them spin down at all. I followed all the guides I could find on how to prevent the drives from spinning up and never had any luck.
You are correct, but that only happens with C: as window needs to do I/O to C: every so often like page swap, etc.

I have 6 drives with nothing on them but recordings. No othe program other than sage has access to them. I can gurantee you that those drives stay down when sage is not using them. I've done extensive testing of this.

But for the C: drive, yes, it's almost always up.
Reply With Quote
  #11  
Old 02-03-2007, 03:18 PM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Quote:
Originally Posted by joe123
You are correct, but that only happens with C: as window needs to do I/O to C: every so often like page swap, etc.
That has not been my experience. I added a second drive to one of my machines to test and the D drive (separate physical disk) would spin up regularly. From what I've read over at silent pc review preventing other drives from spinning up is difficult to impossible with windows.

Quote:
I have 6 drives with nothing on them but recordings. No othe program other than sage has access to them. I can gurantee you that those drives stay down when sage is not using them. I've done extensive testing of this.
How did you get windows to do that? I'd love to spin down my drives as long as the OS isn't bringing them back up every hour or two.
Reply With Quote
  #12  
Old 02-03-2007, 04:52 PM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Quote:
Originally Posted by blade
How did you get windows to do that? I'd love to spin down my drives as long as the OS isn't bringing them back up every hour or two.
I have my BIOS setup to spin-down my drives after 10 minutes of non-use. If nothing is doing I/O to the drives, then they will go to sleep (spin-down) after 10 minutes of non-use.

If Windows is doing the automatic indexing on your D: drive, or if your Windows is setup with "System Resore" turned-ON for your D: drive, then yes, your D: may never go to sleep.

I have everything I can think of turned off for my drives and most of the time when I check them, they are as-sleed and I know that becuase I hear them spin-up when I check them and via their temperature readings as well when checked.
Reply With Quote
  #13  
Old 02-04-2007, 08:30 AM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Quote:
Originally Posted by joe123
I have my BIOS setup to spin-down my drives after 10 minutes of non-use. If nothing is doing I/O to the drives, then they will go to sleep (spin-down) after 10 minutes of non-use.

If Windows is doing the automatic indexing on your D: drive, or if your Windows is setup with "System Resore" turned-ON for your D: drive, then yes, your D: may never go to sleep.

I have everything I can think of turned off for my drives and most of the time when I check them, they are as-sleed and I know that becuase I hear them spin-up when I check them and via their temperature readings as well when checked.
I'm not asking how to get them to spin down. I was wondering how you kept them down. I know how to spin them down and have already disabled all the things you listed and then some. Mine still spin back up. I thought you were claiming to have found a way to prevent the OS from causing them to spin up. Since you said most of the time they're spun down I guess you haven't found a way to prevent windows from accessing the drives.

To test mine I turned off the automatic power down of the drives and manually spun them down with a little program I found. This way I could be certain the drive wouldn't have spun up and back down before I returned. I'd come back every 15 minutes or so to see if it was still spun down. I used a very noisy drive so it would be obvious if it was spun up or not. I never got an exact time, but the drive was always spinning again in an hour or less.

It's just personal preference, but I didn't want my drives spinning up +20 times a day. I'd love to have them spin down when not in use, but I've always had great luck running my drives 24/7 so I'm hesitant to have them spinning up and down a lot.

Last edited by blade; 02-04-2007 at 08:33 AM.
Reply With Quote
  #14  
Old 02-04-2007, 12:53 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
blade, you might try using procmon to monitor the drives and see what processes are accessing which files.
__________________
-- Greg
Reply With Quote
  #15  
Old 02-05-2007, 09:58 AM
joe123 joe123 is offline
Sage Fanatic
 
Join Date: Jan 2006
Posts: 954
Quote:
Originally Posted by blade
I was wondering how you kept them down. .
Blade, not sure what is keeping your drives from spinning down. I know my do after I turned off the things I mentioned above.

I do agree that if the drives are going to spin up and down frequently (several times a day) then it's safer to keep them spinning all the time.

EDIT: Like Greg, another tool which will show you what files are accessing on your drives can be found at:
http://www.microsoft.com/technet/sys...s/filemon.mspx

FileMonitor. Pretty neat.

Last edited by joe123; 02-05-2007 at 10:09 AM.
Reply With Quote
  #16  
Old 02-05-2007, 10:15 AM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by joe123
Same author, procmon basically includes filemon and regmon


Dirk
Reply With Quote
  #17  
Old 02-05-2007, 02:47 PM
cslatt's Avatar
cslatt cslatt is offline
Sage Advanced User
 
Join Date: Nov 2005
Posts: 239
Are you still looking for an easy way to see what, if anything is being recorded? It occurs to me that I already have a class that will parse nielm's GetStatus plugin, it would be quite easy for me to make a commandline program that would output what is currently recording. The only issue I see for you is that nielm's plugin doesn't output filename, just Show Name & Episode Name.
Reply With Quote
  #18  
Old 02-05-2007, 03:01 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by cslatt
Are you still looking for an easy way to see what, if anything is being recorded? It occurs to me that I already have a class that will parse nielm's GetStatus plugin, it would be quite easy for me to make a commandline program that would output what is currently recording. The only issue I see for you is that nielm's plugin doesn't output filename, just Show Name & Episode Name.
Come to that, the source for all of Niel's plugins is freely available, so it should be straightforward for anyone moderately skilled in Java to modify Niel's code to output data directly in whatever format suits your needs. That may not be SIMPLE with a capital S, but it's probably the best option for getting exactly what you want.
__________________
-- Greg
Reply With Quote
  #19  
Old 02-05-2007, 09:40 PM
blade blade is offline
SageTVaholic
 
Join Date: Jan 2005
Posts: 2,500
Thanks for the links. I'm going to check them out when I get a little more time. I'd like to conserve a little power when the server isn't busy.


Quote:
Originally Posted by joe123
I do agree that if the drives are going to spin up and down frequently (several times a day) then it's safer to keep them spinning all the time.
Yeah, I've always ran all of my computers 24/7. Been doing that for 10 years now and have had 1 hard drive die and a power supply. So I've had good luck and don't want to do anything too drastically different.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.