PDA

View Full Version : Backing up gbpvr.mdb



mrming
2005-02-27, 05:58 PM
Hi all,

I had a bit of a disaster with GBPVR today when my gbpvr.mdb file became corrupted. I had been trying to add a custom task to the main menu at the time - I'm not sure whether this had anything to do with it...

Anyway I'd strongly recommend backing up your gbpvr.mdb file on a regular basis. The last backup I've got is from before I upgraded to version 0.9.10 about a week ago and restoring that has meant that all my recordings are out of sync so I've had to archive the lot of them.

I spent around 3 hours trying to recover the damaged .mdb file but to no avail. If anyone out there has experienced 'Error 3197' then I'm sure you'll know what I mean. It seems the only way to recover files corrupted in this manner is by buying this $400 piece of software:

http://www.officerecovery.com/access/order.htm

So beware - back up your .mdb file regularly!

bgowland
2005-02-27, 07:24 PM
Quote[/b] (mrming @ Feb. 27 2005,12:58)]So beware - back up your .mdb file regularly!
If it's any help to anyone then the following is a rough'n'ready batch file to do this. Copy and paste from '@echo off' down to 'pause' into a text file and name it something like BackupMDB.bat and put it on your desktop say. Once you've run it a couple of times, you will always have three backups (bak.1 being most recent etc.) - maybe an overkill but I often do nasty things to my machine as it's still partly a test-bed.

---Don't copy this line---
@echo off
net stop "GB-PVR Recording Service"
c:
cd "\Program Files\devnz\gbpvr"
copy gbpvr.mdb.bak.2 gbpvr.mdb.bak.3
copy gbpvr.mdb.bak.1 gbpvr.mdb.bak.2
copy gbpvr.mdb gbpvr.mdb.bak.1
net start "GB-PVR Recording Service"
pause
---Don't copy this line---

Change lines 3 and 4 to reflect the drive and installation folder if you've installed GB-PVR to somewhere other than the default.

Points to note...
1. Don't run it during a recording as stopping the recording service obviously interrupts the recording (so scheduling this batch file to run automatically at certain times of the day is risky).
2. The first time you run it you will get two errors saying 'The system cannot find the file specified' this is because the bak.2 and bak.1 files don't yet exist.
3. I personally use this batch file but I take no responsibility for anyone trashing their setup through using it. http://gbpvr.com/iB_html/non-cgi/emoticons/biggrin.gif

Cheers,
Brian

mrming
2005-03-01, 03:13 PM
Thanks Brian - I'll give that a try! http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

jimh
2005-03-10, 01:03 AM
Here's a suggestion that will protect against killing the GBPVR service during a recording:

Download my new command-line util RecStatus.exe (see the Community Announcements forum). This utility will return an exit code indicating whether a recording is active or pending within a specified number of minutes. By incorporating this utility into bgowland's batch file, you can abort the backup if RecStatus indicates a recording is underway or about to begin.

jasjol
2005-03-11, 03:36 PM
Do you need to stop recordning for the backup purpose?

the code
c:
cd "\Program Files\devnz\gbpvr"
copy gbpvr.mdb.bak.2 gbpvr.mdb.bak.3
copy gbpvr.mdb.bak.1 gbpvr.mdb.bak.2
copy gbpvr.mdb gbpvr.mdb.bak.1
net start "GB-PVR Recording Service"

works anyway - although you might missa the updates being performed during copy.

Or am I missing something important?

jasjol
2005-03-11, 03:46 PM
can anyone help with what to put in a bat file when I wan't to output - what is shown in the command windows after a command - to a textfile such as log.txt

2005-03-11, 07:38 PM
Jasjol,

To print the output to a text file you use a '>' and then put the path and file. For example:

dir > c:\directory.txt

This will print the current directory list and put it in c:\directory.txt
If the file doesn't exist it is created. If it does exist it is replaced.

To append to the file (don't delete, just add to it) you use '>>'

bgowland
2005-03-12, 02:05 AM
Quote[/b] (jasjol @ Mar. 11 2005,10:36)]Do you need to stop recordning for the backup purpose?
Possibly not but I'd rather not do anything with the database when the recording service is running. After all, the object of the exercise is to take a copy just in case anything nasty happens to it.


Quote[/b] ]the code
c:
cd "\Program Files\devnz\gbpvr"
copy gbpvr.mdb.bak.2 gbpvr.mdb.bak.3
copy gbpvr.mdb.bak.1 gbpvr.mdb.bak.2
copy gbpvr.mdb gbpvr.mdb.bak.1
net start "GB-PVR Recording Service"

works anyway - although you might missa the updates being performed during copy.
By shutting down the service gracefully then any changes the service was about to commit to the database (if any) will be committed cleanly before you take the copy (that's the theory anyway).


Quote[/b] ]Or am I missing something important?
Yes - if you don't use the 'net stop' line to stop the service, you don't need the 'net start' line to start it again. *http://gbpvr.com/iB_html/non-cgi/emoticons/smile.gif

But seriously - call me paranoid if you like but I don't play around with 'live' data objects. If I get time tomorrow, I'll post a revision to the batch file that uses jimh's RecStatus.exe to tell whether or not a recording is in process - this will allow a scheduled backup job to run.

Cheers,
Brian

jasjol
2005-03-12, 06:24 PM
Quote[/b] (Guest @ Mar. 11 2005,20:38)]Jasjol,

To print the output to a text file you use a '>' and then put the path and file. *For example:

dir > c:\directory.txt
ok about output - I do get dir > txt.txt to work - the txt.txt file contains what is in the directory.

But I still do not understand how I can put all the text that shows in a command window when running for example the code below to txt.txt
(for example that the file was copied and that my XMLTV was fetched etc)

the code
c:
cd "\Program Files\devnz\gbpvr"
copy gbpvr.mdb.bak.2 gbpvr.mdb.bak.3
copy gbpvr.mdb.bak.1 gbpvr.mdb.bak.2
copy gbpvr.mdb gbpvr.mdb.bak.1

[/QUOTE]
[QUOTE]

bgowland
2005-03-13, 02:20 AM
Try...

-----------------------------------------------
c:
cd "\Program Files\devnz\gbpvr"
copy gbpvr.mdb.bak.2 gbpvr.mdb.bak.3 > log.txt
copy gbpvr.mdb.bak.1 gbpvr.mdb.bak.2 >> log.txt
copy gbpvr.mdb gbpvr.mdb.bak.1 >> log.txt
-----------------------------------------------

NOTE - first copy command uses a single > so will delete the previous log.txt file. If you want to keep it then use >> instead.

Brian

PS Urrrm, what XMLTV file?