|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Script for backing up before updating Sage installation
Here is a little script I put together that will backup your SageTV directories, and also backup your irremote.ini. Makes installation of another version of SageTV a little less tedious. After the installation is done, I usually copy the backed-up version of the irremote back into the windows directory.
Code:
@echo off SET SageTVDir=C:\Program Files\SageTV SET backupDir=C:\Sage Backup\SageTV backups SET windowsDir=C:\WINDOWS FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B SET date=%mm%-%dd%-%yyyy% SET folderName=Sage backup %date% MKDIR "%backupDir%\%folderName%" ECHO Backing up SageTV Common directory MKDIR "%backupDir%\%folderName%\Common" XCOPY "%SageTVDir%\Common" "%backupDir%\%folderName%\Common" /s ECHO Backing up SageTV directory MKDIR "%backupDir%\%folderName%\SageTV" XCOPY "%SageTVDir%\SageTV" "%backupDir%\%folderName%\SageTV" /s ECHO Backing up Irremote.ini COPY "%windowsDir%\Irremote.ini" "%backupDir%\%folderName%" MOVE "%backupDir%\%folderName%\Irremote.ini" "%backupDir%\%folderName%\Irremote%date%.ini" ECHO Backup for %date% complete Please feel free to post improvements, as I'm sure there are lots that could be made!
__________________
-Eric Client: STX-HD100 Extender, Connected to 47" Visio 1080p LCD via HDMI, Running SageMC Client: Media MVP Running SageMC Server: Antec SLK3800B, AMD Athlon 64 X2 4200+, Biostar TForce 550, GeForce 7300LE, 1GB DDR2 800, 2 x HVR-1600, PVR-150MCE, 1.4TB HD Space, XP Pro, Java6, Latest SageTV Version |
#2
|
|||
|
|||
What is the irremote.ini file used for? Is it all of your remote's learned commands in Sage?
__________________
-Jason |
#3
|
||||
|
||||
Quote:
I have mine tailored so that I can use different buttons for different commands in Sage on my Hauppauge remote. Since I use FSE, I can use the "full" button for Commercial advace, and I gave up the "Mute" button so that I can use it for going to the previous commercial segment. You can also change stuff like making your up and down keys work as volume keys or vs. versa. At least thats how it works with the Hauppauge remote controls. Its kind of a pain to configure so once you have one that works you want to make a back up of it. The Sage installation over writes the irremote.ini file so your changes will be lost if you don't have a backup. Last edited by Humanzee; 03-09-2006 at 06:03 PM. |
#4
|
||||
|
||||
It is specifically for configuring the Hauppauge remote & is used only by Hauppauge's IR.exe software; it isn't used or accessed directly by SageTV (except for adding config stuff during installation).
IR codes (assigned to commands in Detailed Setup) that are learned by SageTV when using something like a USB-UIRT are stored in the properties file. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#5
|
||||
|
||||
I modified your script to suit my system, worked like a charm. Thanks.
|
#6
|
||||
|
||||
Quote:
__________________
-Eric Client: STX-HD100 Extender, Connected to 47" Visio 1080p LCD via HDMI, Running SageMC Client: Media MVP Running SageMC Server: Antec SLK3800B, AMD Athlon 64 X2 4200+, Biostar TForce 550, GeForce 7300LE, 1GB DDR2 800, 2 x HVR-1600, PVR-150MCE, 1.4TB HD Space, XP Pro, Java6, Latest SageTV Version |
#7
|
|||
|
|||
What would i change in this script to get the backup on another drive than the C one?
Thank you,
__________________
itsa Server: Intel Core 2 Quad Q8200 @ 2.33GHz, ASUS P5QL, 3GB RAM, 750 GB USB drive, WinTV-HVR-2250 Dual Tuner 2 SageTV Media Extender: MediaMVP (wired) Software: SageTV 7.0.23 WHS |
#8
|
||||
|
||||
Quote:
Code:
SET SageTVDir=C:\Program Files\SageTV SET backupDir=C:\Sage Backup\SageTV backups SET windowsDir=C:\WINDOWS backupDir is the base directory where you want the backups to go. windowsDir is where you have windows installed (you should not have to change this line). If I understand your question, you'll be wanting to change the path assigned to backupDir.
__________________
-Eric Client: STX-HD100 Extender, Connected to 47" Visio 1080p LCD via HDMI, Running SageMC Client: Media MVP Running SageMC Server: Antec SLK3800B, AMD Athlon 64 X2 4200+, Biostar TForce 550, GeForce 7300LE, 1GB DDR2 800, 2 x HVR-1600, PVR-150MCE, 1.4TB HD Space, XP Pro, Java6, Latest SageTV Version |
#9
|
|||
|
|||
Good job! It works really good!
After i back it up, i zip the backup into a single zip file onto my SageTV's recording external drive. Thank you,
__________________
itsa Server: Intel Core 2 Quad Q8200 @ 2.33GHz, ASUS P5QL, 3GB RAM, 750 GB USB drive, WinTV-HVR-2250 Dual Tuner 2 SageTV Media Extender: MediaMVP (wired) Software: SageTV 7.0.23 WHS |
#10
|
|||
|
|||
Thanks for creating the script one enhancement suggeston is if possible include a check of the previous drectories to that you can control the number as if you have it set to run on a schedule sooner or later you will need to manually delete the old entries. If if could be set to only keep the most recent xx days so it is always pruning.
|
#11
|
||||
|
||||
Quote:
I wouldn't recommend using this script on a routine basis, because it creates a complete backup of your SageTV folder. I'm not sure how it is on your system, but on mine a single backup is over 200Mb! What I would suggest is manually using this script to do a complete backup each time you install a new version, and then do incremental backups of your sage.properties and wiz.bin files (among others). I know that at one point I had my system running a scheduled job that would just copy the important files on a regular basis. Here is the thread detailing the procedure I used. You could create a job for each day of the week, and have a rolling week's worth of backups if you needed them. Hope that helps.
__________________
-Eric Client: STX-HD100 Extender, Connected to 47" Visio 1080p LCD via HDMI, Running SageMC Client: Media MVP Running SageMC Server: Antec SLK3800B, AMD Athlon 64 X2 4200+, Biostar TForce 550, GeForce 7300LE, 1GB DDR2 800, 2 x HVR-1600, PVR-150MCE, 1.4TB HD Space, XP Pro, Java6, Latest SageTV Version |
#12
|
|||
|
|||
I am working on an update to this backup script to do a zip at the end for all the files so that it will be in 1 file.. Just easier to manage imo..
|
#13
|
|||
|
|||
ok, updated the backup script..
Notes
You need to goto http://www.rarlab.com/download.htm and download the MSDos version. You need 2 files from that:
Put those files in the same location as your backup.bat file Use the following new backup.bat Code:
@echo off SET SageTVDir=C:\Program Files\SageTV SET backupDir=C:\Sage Backup\SageTV backups SET windowsDir=C:\WINDOWS FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B SET date=%mm%-%dd%-%yyyy% SET folderName=Sage backup %date% MKDIR "%backupDir%\%folderName%" ECHO Backing up SageTV Common directory MKDIR "%backupDir%\%folderName%\Common" XCOPY "%SageTVDir%\Common" "%backupDir%\%folderName%\Common" /s ECHO Backing up SageTV directory MKDIR "%backupDir%\%folderName%\SageTV" XCOPY "%SageTVDir%\SageTV" "%backupDir%\%folderName%\SageTV" /s ECHO Backing up Irremote.ini COPY "%windowsDir%\Irremote.ini" "%backupDir%\%folderName%" MOVE "%backupDir%\%folderName%\Irremote.ini" "%backupDir%\%folderName%\Irremote%date%.ini" ECHO Doing the compression Part [joey3002 1-14-2009] %backupDir%\rar32.exe a "%folderName%".rar "%backupDir%\%folderName%" ECHO Delete Backed up Directory but KEEP compressed backup rd /s /q "%backupDir%\%folderName%" ECHO Backup for %date% complete ECHO Remove this pause if you do not want to be prompted when this is done pause Thanks to the orig poster for starting this fine backup batch file.. |
#14
|
||||
|
||||
Glad it's still relevant and helpful after all this time!
__________________
-Eric Client: STX-HD100 Extender, Connected to 47" Visio 1080p LCD via HDMI, Running SageMC Client: Media MVP Running SageMC Server: Antec SLK3800B, AMD Athlon 64 X2 4200+, Biostar TForce 550, GeForce 7300LE, 1GB DDR2 800, 2 x HVR-1600, PVR-150MCE, 1.4TB HD Space, XP Pro, Java6, Latest SageTV Version |
#15
|
|||
|
|||
Saving my bacon
Was tinkering around with EG and some KVM swapping software over lunch yesterday. On a few of the swapping events, an unfortunate side effect was the ungracefull termination of Sage. I was eventually successful in getting the script right and polishing off the last of the orange beef. I returned to work and spent the rest of the afternoon defending the free world from Democracy. Came home and turned on the set to watch some recordings. EMPTY LIST. A few moments of panic and then I look in the SageTV subdirectory and spy the wiz.bin.corrupt0 entry.
In the old days, I would have screamed, pulled a few more hairs out and generally cursed the existence of all moderen technology. However after finding your little routine and putting it on autopilot, the worst I had to do was retrieve a day-old wiz.bin file. The better half never knew what was happening. Thanks again for this little routine. I never really considered the value when tweaking it to run on my system, but I can tell you it's priceless when the time comes to recover.
__________________
Frankentivo: iStar D-380HB, SuperMicro X107-F-O, Xeon 1270v3 CPU, Kingston 8 GB 1600MHz DDRR3L x 4 Tuners: 4 x HDHR OTA, 4 x HDHR3 OTA, 3 x HDHR Prime UnRAID Pro: 1 x Samsung 500GB Cache, 5 x WD Red 4TB (1 Parity, 4 Data) Extenders: 2 x HD-200, 1 x HD-300 on Atlona PRO3HD66m Sage: V9.0.14.567 with OpenDCT on unRaid docker, Gemstone, BMT, Web UI, PlayOn, TiSage |
#16
|
|||
|
|||
Nice routine to back up for a update..gets everything. To use this for a daily backup is overkill. What exact list of files should be backed up daily?
win.bin sage.properties ... |
#17
|
|||
|
|||
I did some work on the original backup script too:
- now it stops on error and properly reports it via errorlevel -- i.e. caller can detect if smth went wrong (useful for automation, also prevents stupid things like removing all files at the root just because previous 'cd' failed) - two modes -- manual and automatic, in manual script will stop (pause) on error - logging via 'mtee' utility. It is relatively simple to automate log cleanup procedure (e.g. remove all log files older than 1 month) Note: - I do not backup Irremote.ini because I do not have any - backup logic consists of two parts -- generic backup.bat wrapper (provides logging & some error handling magic) and batch script (e.g. SageTV.bat) with specific logic. It is quite extensible in this way. - Usage: Code:
backup <logic> [auto|manual] e.g. Code:
backup SageTV auto |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|