SageTV Community  

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

Notices

SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer.

Reply
 
Thread Tools Search this Thread Display Modes
  #1321  
Old 12-07-2012, 10:48 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Yes. Can easily live with that. Greatly appreciated
Reply With Quote
  #1322  
Old 12-07-2012, 11:55 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
QQ. How do you specify within Groovy which SageTV Server to use?
Since I have multiple SageTV Servers running
Reply With Quote
  #1323  
Old 12-07-2012, 12:20 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by graywolf View Post
QQ. How do you specify within Groovy which SageTV Server to use?
Since I have multiple SageTV Servers running
Grab the javadocs for sagex and lookup SageAPI.setProvider(); you'll want to pass it an instance of RMISageAPI with the host or IP of the Sage server you want to force sagex to connect to.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1324  
Old 12-16-2012, 11:42 PM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
I just reinstalled sage onto windows 8. I copied over my stuff from before to do comskip, but I'd like to have restart the service nightly and also do backups. Before I had batch files/windows scheduled tasks to do that.

One thing I see is that even with UAC off and the account an administrator, I cannot launch a batch file with elevated privileges...it won't let me start/stop the sage tv service. How do you guys get around that?

And would anyone be willing to share or point me to where I could find some examples for the restart and for the backup?
Reply With Quote
  #1325  
Old 12-17-2012, 09:25 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by phareous View Post
I just reinstalled sage onto windows 8. I copied over my stuff from before to do comskip, but I'd like to have restart the service nightly and also do backups. Before I had batch files/windows scheduled tasks to do that.

One thing I see is that even with UAC off and the account an administrator, I cannot launch a batch file with elevated privileges...it won't let me start/stop the sage tv service. How do you guys get around that?

And would anyone be willing to share or point me to where I could find some examples for the restart and for the backup?
Here are the SJQ scripts for backing up your SageTV directory:

https://sagetv-addons.googlecode.com...up_test.groovy

https://sagetv-addons.googlecode.com..._backup.groovy

The first is the test script to determine if it's "safe" to shutdown Sage. The second script is the actual backup script. Read the comments in both carefully.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1326  
Old 12-18-2012, 08:34 AM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Quote:
Originally Posted by Slugger View Post
Here are the SJQ scripts for backing up your SageTV directory:

https://sagetv-addons.googlecode.com...up_test.groovy

https://sagetv-addons.googlecode.com..._backup.groovy

The first is the test script to determine if it's "safe" to shutdown Sage. The second script is the actual backup script. Read the comments in both carefully.
Thanks for the info. Stupid question here but how do I make it execute the backup groovy script? If I just put the script name under the executable option, it won't run it - it says it is not a valid win32 application. The instructions just say "Configure your standalone task client to run this new task." with no further details. The only task I've ever used is comskip which is an executable...never tried to use a groovy script as an executable.

Also one issue I had with the test script is that I may have extenders connected but not doing anything...so simply testing for connection is going to keep it from running. Does anyone have an example on how to test if an extender is actually playing something?
Reply With Quote
  #1327  
Old 12-18-2012, 08:45 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by phareous View Post
Thanks for the info. Stupid question here but how do I make it execute the backup groovy script? If I just put the script name under the executable option, it won't run it - it says it is not a valid win32 application. The instructions just say "Configure your standalone task client to run this new task." with no further details. The only task I've ever used is comskip which is an executable...never tried to use a groovy script as an executable.
https://code.google.com/p/sagetv-add...sk_Executables

Quote:
Also one issue I had with the test script is that I may have extenders connected but not doing anything...so simply testing for connection is going to keep it from running. Does anyone have an example on how to test if an extender is actually playing something?
http://sagetv-addons.googlecode.com/...e-summary.html

Specifically, the isMediaPlaying() method is probably what you're looking for.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1328  
Old 12-18-2012, 09:16 AM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Quote:
Originally Posted by Slugger View Post
https://code.google.com/p/sagetv-add...sk_Executables



http://sagetv-addons.googlecode.com/...e-summary.html

Specifically, the isMediaPlaying() method is probably what you're looking for.
So according to that, you can simply name the file something.groovy and use it as a task executable...that isn't working for me. Does the .groovy file need to be associated with something in windows? ANy ideas how I can fix that?
Reply With Quote
  #1329  
Old 12-18-2012, 09:33 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by phareous View Post
So according to that, you can simply name the file something.groovy and use it as a task executable...that isn't working for me. Does the .groovy file need to be associated with something in windows? ANy ideas how I can fix that?
As it says, when using a groovy script as an executable in a task, you must prefix the script name with script: so SJQ knows to run the script thru its groovy engine instead of passing it to the OS to execute it as a native executable. So when defining your task, you must explicitly define the executable as (literally):

script:C:/path/to/script/full_backup.groovy
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1330  
Old 12-18-2012, 09:43 AM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Quote:
Originally Posted by Slugger View Post
As it says, when using a groovy script as an executable in a task, you must prefix the script name with script: so SJQ knows to run the script thru its groovy engine instead of passing it to the OS to execute it as a native executable. So when defining your task, you must explicitly define the executable as (literally):

script:C:/path/to/script/full_backup.groovy
Sorry for my reading comprehension failure. Thanks for being patient with me
Reply With Quote
  #1331  
Old 12-18-2012, 10:06 AM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Well I must be doing something obviously wrong, but I am not sure what it is...

if (Global.isMediaPlaying()) {
println "Something is playing"
return 1
}

Gives this:

Caused by: groovy.lang.MissingMethodException: No signature of method: sagex.api.Global.isMediaPlaying() is applicable for argument types: () values: []
Reply With Quote
  #1332  
Old 12-18-2012, 10:44 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by phareous View Post
Well I must be doing something obviously wrong, but I am not sure what it is...

if (Global.isMediaPlaying()) {
println "Something is playing"
return 1
}

Gives this:

Caused by: groovy.lang.MissingMethodException: No signature of method: sagex.api.Global.isMediaPlaying() is applicable for argument types: () values: []
https://sagetv-addons.googlecode.com...alHelpers.html

At the top:

com.google.code.sagetvaddons.groovy.api.GlobalHelpers

You're calling it incorrectly. You need to import the GlobalHelpers class and then call:

GlobalHelpers.isMediaPlaying()
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1333  
Old 12-18-2012, 11:40 AM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Quote:
Originally Posted by Slugger View Post
https://sagetv-addons.googlecode.com...alHelpers.html

At the top:

com.google.code.sagetvaddons.groovy.api.GlobalHelpers

You're calling it incorrectly. You need to import the GlobalHelpers class and then call:

GlobalHelpers.isMediaPlaying()
Thanks I had tried that and it did not work, but I didn't have the import. With the import now it works:

import com.google.code.sagetvaddons.groovy.api.GlobalHelpers;

Now the test passes but the other script fails with this:

javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 179: The class 'BackupMatcher' has an incorrect modifier private

I changed the class to public and it works...but not sure why it didn't work from the original example
Reply With Quote
  #1334  
Old 12-18-2012, 11:43 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
The example was written against Groovy 1.x. Recently, Groovy was upgraded to 2.0 and private members are no longer valid in groovy scripts. Changing it to public is the fix. The (generic) issue/fix was discussed somewhere in this thread when the upgrade to Groovy 2.0 was done.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1335  
Old 12-18-2012, 12:26 PM
phareous phareous is offline
Sage Advanced User
 
Join Date: Jul 2009
Posts: 234
Quote:
Originally Posted by Slugger View Post
The example was written against Groovy 1.x. Recently, Groovy was upgraded to 2.0 and private members are no longer valid in groovy scripts. Changing it to public is the fix. The (generic) issue/fix was discussed somewhere in this thread when the upgrade to Groovy 2.0 was done.
Thank you...everything seems to be working now. I appreciate your help with this
Reply With Quote
  #1336  
Old 12-18-2012, 06:48 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by phareous View Post
Thanks for the info. Stupid question here but how do I make it execute the backup groovy script? If I just put the script name under the executable option, it won't run it - it says it is not a valid win32 application. The instructions just say "Configure your standalone task client to run this new task." with no further details. The only task I've ever used is comskip which is an executable...never tried to use a groovy script as an executable.

Also one issue I had with the test script is that I may have extenders connected but not doing anything...so simply testing for connection is going to keep it from running. Does anyone have an example on how to test if an extender is actually playing something?
Not if something is playing since I have 1 extender playing live tv (white noise for sleeping) so I check to see if anything is scheduled to record.

Code:
/*
    SageTV backup tool tester (i.e. is it "safe" to stop and backup SageTV?)
    Last Modification: 2011-11-21
               Original Author: Derek Battams <derek AT battams DOT ca>
                              
    Use this script as the test for the full_backup.groovy script.  Basically this
    script just checks a bunch of conditions to determine if it is "safe" to shutdown
    SageTV and perform the app dir backup.  Remove/add/modify conditions to your needs
    below.
    
    Remember, return 1 to push the task back to the queue, 0 to tell SJQ to run the backup script
    or 2 to tell SJQ to skip the backup.
*/

def now = System.currentTimeMillis()
def reqdMins = 45L
int ScheduledRecording = 0 ;

println " ";
Global.GetScheduledRecordingsForTime(now, now + (reqdMins * 60000L)).each { mfAiring ->
    if( AiringAPI.IsNotManualOrFavorite(mfAiring) ) { 
       println (ShowAPI.GetShowTitle(mfAiring) + " is LiveTV - no issue");
    } else {
       ScheduledRecording = ScheduledRecording + 1 ;
       println ( ShowAPI.GetShowTitle(mfAiring) + " is Scheduled to record within $reqdMins minutes") ;
    } 
}

if ( ScheduledRecording > 0 ) {
    // Scheduled Recording upcoming, Return for when it is safe
    println ( "Returned to Queue until safe to process");
    sleep 900000
    return 1
} else {
    // Looks to be safe, let's do this!!
    println ("Safe to kick off Backup job. No recordings scheduled within $reqdMins minutes");
    return 0
}
Reply With Quote
  #1337  
Old 12-18-2012, 06:51 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by Slugger View Post
The example was written against Groovy 1.x. Recently, Groovy was upgraded to 2.0 and private members are no longer valid in groovy scripts. Changing it to public is the fix. The (generic) issue/fix was discussed somewhere in this thread when the upgrade to Groovy 2.0 was done.
Haven't upgraded yet...probably need to and check my scripts to make sure they work properly.

Just need to find some "downtime" to work on it without breaking anything.
Reply With Quote
  #1338  
Old 12-20-2012, 05:14 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by Slugger View Post
Yeah... likely a job was added to the queue and the media file for that object was deleted or somehow invalidated and the job got caught in an infinite loop of running, being sent back to the queue, retrying, back to the queue, retrying, etc. This issue was fixed long ago, but it seems you've found another code path to the issue.
this has reoccurred and my HD almost filled up again. One other weird thing is that I now cannot get into the SJQ part of the web UI. Everything else in the web UI works but when I try Job Queue, Manage Clients or Manage Events I get no response. But Queue a task and Manage Crontab work ok. I have tried rebooting a few times with no luck as of yet but I haven't tried using the SJQ Sage UI to examine and kill the tasks.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #1339  
Old 12-20-2012, 05:47 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by wayner View Post
this has reoccurred and my HD almost filled up again. One other weird thing is that I now cannot get into the SJQ part of the web UI. Everything else in the web UI works but when I try Job Queue, Manage Clients or Manage Events I get no response. But Queue a task and Manage Crontab work ok. I have tried rebooting a few times with no luck as of yet but I haven't tried using the SJQ Sage UI to examine and kill the tasks.
It sounds like there's thousands of jobs in the queue table. That's probably why the web pages aren't responding. I doubt the STVi screens are going to respond either.

Directly connect to the H2 database and clean up the queue. I've never been able to pinpoint the cause of this situation as I've never experienced it myself, but there's obviously a condition that occurs that results in multiple (copies?) of jobs being added to the queue and constantly rerun.
__________________
Twitter: @ddb_db
Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive
Capture: 2 x Colossus
STB Controller: 1 x USB-UIRT
Software:Java 1.7.0_71; SageTV 7.1.9
Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter
Plugins: Too many to list now...
Reply With Quote
  #1340  
Old 12-20-2012, 06:17 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
How do I connect to the H2 database? I read this but it doesn't really see to apply?

https://code.google.com/p/sagetv-add...ki/H2LobsCache

D I follow the instructions from here https://code.google.com/p/sagetv-add...ModifyDatabase
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 4 (0 members and 4 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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) cslatt SageTV Customizations 48 06-11-2012 10:44 AM
SJQv4: Technology Preview Slugger SageTV v7 Customizations 39 12-17-2010 01:17 PM
SageTV Plugin Developers: Any way to see stats for your plugin? mkanet SageTV Software 4 12-12-2010 10:33 PM
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin deria SageTV Customizations 447 12-11-2010 07:38 PM
SJQv4: Design Discussion Slugger SageTV v7 Customizations 26 10-18-2010 08:22 AM


All times are GMT -6. The time now is 03:38 AM.


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