INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Automatic Library Backups  (Read 2584 times)

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Automatic Library Backups
« on: December 06, 2009, 04:09:34 pm »

What controls the scheduling of automatic library backups?  In particular, how do I get them to run more often than every several days, which is when they run now?

I have had my library "crash" (for lack of a better term) several times, leading me to have to use the backup.  What happens is that when I start MC, the library will be mostly empty.  It had been OK the previous day, or earlier in the current day.  What information can I provide you to help troubleshoot this?  Currently running 14.0.88 on Vista Business 64-bit.
Logged

221bBS

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 703
Re: Automatic Library Backups
« Reply #1 on: December 06, 2009, 06:10:50 pm »

Can't help with having MC backup more often but I am curious to know if you have any ideas as to why MC deletes most of your library. Any time MC crashes on me nothing in my library gets damages except maybe the last minute of work is deleted.

Only thing that I can think of that would do this is if you move you files around outside of MC and you have "update for external changes" and "fix broken links" turned on.
Logged

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Re: Automatic Library Backups
« Reply #2 on: December 06, 2009, 06:22:08 pm »

I do have "update for external changes" and "fix broken links" turned on, but the library problem doesn't seem to relate to MC itself crashing.  Today's library problem came about after a normal shutdown.  And I did no moving of media files in between.  As did the previous cases I can remember.

That's not to say the MC doesn't crash sometimes, but this has not seemed to cause library problems.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72543
  • Where did I put my teeth?
Re: Automatic Library Backups
« Reply #3 on: December 06, 2009, 06:24:33 pm »

For crash problems, please see this link.
Logged

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Re: Automatic Library Backups
« Reply #4 on: December 06, 2009, 06:30:06 pm »

My current complaint has nothing to do with the MC program crashing.  It's just that the library lost most of its content between a normal shutdown and starting the next time.  I apparently do not have logs enabled.  I will enable them and see what it records, the next time this happens.
Logged

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Re: Automatic Library Backups
« Reply #5 on: December 06, 2009, 06:40:08 pm »

More information. in case it matters.  I run MC on two computers (WinXP SP3 [this is my HTPC and where I run it usually] and Vista x64 SP2, but use the same library stored which is stores on a Windows Home Server.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72543
  • Where did I put my teeth?
Re: Automatic Library Backups
« Reply #6 on: December 06, 2009, 06:43:26 pm »

Yes.  It probably matters.  If you need to share a library, try using Library Server.
Logged

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Re: Automatic Library Backups
« Reply #7 on: December 06, 2009, 06:59:08 pm »

Quote
try using Library Server.
I tried that once but found it to be annoyingly slow.  In particular, slow to open video files to play.  Like 10 seconds maybe.

Also, can I run a MC Library server on a Windows Home Server machine?  Which is where all my terabytes of media files reside.  In my case an Acer Aspire H340.  I don't want to have to run my power-hungry main PC whenever I want to use my HTPC.

And, to clarify, both the library itself and all the media files are on the Windows Home Server machine.  I set it up this way on the recommendation of someone on this forum.  Previously, I had separate libraries on both machines, reading the same media files, and was having problems keeping the two libraries in sync.

Also, I don't run both copies of MC (on the two compiters) at the same time.  In particular, today when the library problem happened, I'm sure I wasn't.
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72543
  • Where did I put my teeth?
Re: Automatic Library Backups
« Reply #8 on: December 06, 2009, 07:10:09 pm »

In particular, slow to open video files to play.  Like 10 seconds maybe.
Wow.  10 seconds!
Logged

pwantzel

  • World Citizen
  • ***
  • Posts: 112
Re: Automatic Library Backups
« Reply #9 on: December 06, 2009, 07:17:13 pm »

Quote
Wow.  10 seconds!
Did you mean "Wow. 10 seconds!  That's really a long time."  or was it, "Wow. 10 seconds is a short time, too short to be complaining about."
Logged

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatic Library Backups
« Reply #10 on: December 07, 2009, 10:56:21 am »

I run multiple copies of MC all pointing at the same library on a network share without issue, and have for a LONG time.  You can even open multiple copies of MC at once now, as it is smart enough to lock the database as read-only once one copy has it open read/write.  MC has never wiped out my library on me, so if this is happening to you, something else is going on (my guess is a delayed write failure).

The Library Server didn't work for me before for primarily this same reason (video playback performance).  I haven't tested it recently, and I know Yaobing has made some changes in this space.  However, a 10-15 second delay before playback starts wouldn't be acceptable for me either.

It is easy enough to script 7-Zip to create zip file archives of your library on a timed basis via the command line, and schedule it via Window's Scheduled Tasks utility.  I used to do this before MC had a built-in backup feature.

Here is an example of my old backup script (this was written to use ZipGenius, which I used to use before I switched to 7-Zip):
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: Automatic Library Backups
« Reply #11 on: December 07, 2009, 11:02:56 am »

Code: [Select]
<package>
<job id="vbs">
<script language="VBScript">

'USER DEFINED VARIABLES
'If you need to modify this script to use your own file locations,
'you can modify the paths here.  You must do this with all of the
'applicable scripts.

'This is where you want the "shared" library to live.  It must be
'on a network drive that can be accessed by all the machines that will
'be synced by the scripts.  Be sure to include the trailing "\" as part
'of the path you give.
strSharedLibraryDir = "M:\library_data\"

'This is where each machines' local library will live.  This must be
'the same for all the computers using these scripts and it must exist.
'Again, be sure to include the trailing "\".
strLocalLibraryDir = "C:\library_data\"

'This is the name of your library in MC.  This is what the subfolder
'containing your library inside the above directories will be called.
strLibraryName = "andoria"

'This is where you've installed these scripts.
strMyDirectory = "O:\Users\Shared\scripts\MC_Scripts\"

'This is where the zg.exe file is located.  This should be inside the ZipGenius6
'folder.  If you haven't installed ZipGenius6, it is required for this archive
'script to work properly.  You can download it for free from here:
'http://zipgenius.it
'It's a great, completely free WinZip alternative (much more powerful too)!
strZGLocation = "C:\Program Files\ZipGenius 6\zg.exe"

'END USER DEFINED VARIABLES


'ALL USER DEFINED VARIABLES ARE ABOVE THIS LINE
'DON'T MODIFY ANYTHING BELOW HERE

'Create our handy dandy Shell object
set WshShell = WScript.CreateObject("WScript.Shell")
'We also need a FileSystemObject object
set FileSys = CreateObject("Scripting.FileSystemObject")

'Handy Variables
strMyName = "MC_Library-Archive"
strSharedLibrary = strSharedLibraryDir & strLibraryName
strSharedBackup = strSharedLibraryDir & "backup\"
strLocalLibrary = strLocalLibraryDir & strLibraryName
strLocalBackup = strLocalLibraryDir & "backup\"
strExcludeFile = strMyDirectory & "exclude.txt"
strLogFile = strSharedLibraryDir & "ScriptLog.txt"
strPublishedFlag = strSharedLibraryDir & "published.flag"
'This is the text used by XCOPY to create the datestamp in the file name with options
strBackupNameText = strLibraryName & "-backup-%date:~10,4%%date:~4,2%%date:~7,2% /E /C /I /H /Y /EXCLUDE:"

'Special Archive Variables
strBackupZipFile = strSharedLibraryDir & "backup.zip"
strFinalZip = strSharedLibraryDir & strLibraryName & "-backup_%date:~10,4%%date:~4,2%%date:~7,2%.zip"
strBackupSpec = strSharedBackup & "*.*"

'Check for "/verbosity:on" argument
set colNamedArguments = WScript.Arguments.Named
If colNamedArguments.Exists("verbosity") then
'Assign the value to the strVerbosity variable and check to see if it's valid
strVerbosity = colNamedArguments.Item("verbosity")
if not (strVerbosity = "on" or strVerbosity = "off") then
WshShell.Popup strMyName & " ERROR:" & VbCrLf & VbCrLf & "/verbosity option given with invalid value.  Available values are ""on"" or ""off"".  Value given was: " & strVerbosity, 15, , vbExclamation
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : " & strMyName & " failed (invalid /verbosity): %DATE% %TIME% >> " & strLogFile, 0, False
WScript.quit
end if
else
'Set strVerbosity to the default value of off
strVerbosity = "off"
end if

'SCRIPT ACTUALLY STARTS DOING STUFF HERE

'Note start time in the Log
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : MC Archive started: %DATE% %TIME% >> " & strLogFile, 0, False

'Check to see if ZipGenius is installed
If Not FileSys.FileExists(strZGLocation) then
WshShell.Popup strMyName & " ERROR:" & VbCrLf & VbCrLf & "ZipGenius does not appear to be installed!  Archive operation will not be enabled." & VbCrLf & VbCrLf & "To download and install the free ZipGenius utility, visit: http://zipgenius.it/", 15, , vbExclamation
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : " & strMyName & " failed (ZipGenius6 not present): %DATE% %TIME% >> " & strLogFile, 0, False
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : To download the free ZipGenius utility, please visit http://zipgenius.it/ >> " & strLogFile, 0, False
WScript.quit
else
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : " & strMyName & " located ZipGenius6: %DATE% %TIME% >> " & strLogFile, 0, False
end if

'Kill off any old backups you find hanging out.
WshShell.Run "%comspec% /c rmdir /S /Q " & strSharedBackup, 0, True
WshShell.Run "%comspec% /c rmdir /S /Q " & strLocalBackup, 0, True

'Make a backup of the current Shared Library
WshShell.Run "%comspec% /c xcopy " & strSharedLibrary & " " & strSharedBackup & strBackupNameText & strExcludeFile, 0, True

'Deleting the old leftover backup.zip file, if it exists
if FileSys.FileExists(strBackupZipFile) then
FileSys.DeleteFile strBackupZipFile, True
end if

'Run the ZipGenius task
WshShell.Run "zg.exe -add """ & strBackupZipFile & """ C9 R1 +""" & strBackupSpec &"""", 7, True

'Copy the file over to what it should be called long term, then delete the temp one
WshShell.Run "%comspec% /c copy /Y " & strBackupZipFile & " " & strFinalZip, 0, True
if FileSys.FileExists(strBackupZipFile) then
FileSys.DeleteFile strBackupZipFile, True
end if

'If the user asked for a popup message (via the /verbosity:on command line option) then give them one
if (strVerbosity = "on") then
WshShell.Popup strMyName & " finished!", 5, , vbInformation
end if

'Note end time in the Log
WshShell.Run "%comspec% /c echo %COMPUTERNAME% : " & strMyName & " finished: %DATE% %TIME% >> " & strLogFile, 0, False
</script>
</job>
</package>
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

HiFiTubes

  • Citizen of the Universe
  • *****
  • Posts: 1123
Re: Automatic Library Backups
« Reply #12 on: December 07, 2009, 12:49:53 pm »

I just set up a Touchsmart 300 (w/ HD3200 onboard) and after install of CCCP, default playback of Watchmen 1080P .mkv over Library Server was flawless and started up right away, with 6% cpu usage. Touchsmart is the client.
Logged
Pages: [1]   Go Up