Automatic system and power shutdown
If anyone is interested, I have a very simple program that can be used with SageTV that can be used to automatically shutdown the computer if there is nothing to record. This is not a perfect solution for all.
It looks to see if there are any scheduled recordings as of a specific time and then can shut down the computer, or do something else, if not. It does not check to see if the SageTV program is being used at the time to view recordings.
The whole setup first assumes that the BIOS is setup so that the computer automatically turns on at a specific time each day. I have it set to 6PM. Then the SageTV is part of the automatic startup sequence. When SageTV starts, it looks in the file Sage.properties and if it finds the line:
scheduler_export_file=c\:\\sage_schedule.dat
it will generate a file c:\sage_schedule.dat which has a list of the things being recorded. Then a scheduled event is setup (I have it setup to 6:30 PM) to call the batch file startup_copy.bat, this will also save a copy of the sage_schedule.dat file, this can be removed, it is the first line in the file.
The program sage_sched_dec is then called and if it does not find anything to be recorded, a call is made to shutdown_bat.bat which will unconditionally shutdown the computer.
Finally, I have another scheduled event to always shutdown at 12:30AM so the computer will still automatically shutdown if something is being recorded. This event just calls shutdown_bat.bat
All the files in the posted attachment should be put in the same directory such as c:\bat
The source file is included if anyone would like to play with it.
|