Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 07-03-2012, 02:00 PM   #1
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
speed up metadata backup

Is there a way to speed up metadata backup? I'm in the process of backing up my library so I selected the "Start backing up metadata of all books" to update the opf files but it's taking forever to finish (1 book every 3 sec per the dialog). I know the opf files it creates are just failsafes in case metadata.db gets corrupted nevertheless, I'd like to have those updated before I backup my Calibre library. Thanks!
ilovejedd is offline   Reply With Quote
Old 07-03-2012, 03:56 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
OPF files are normally updated any time you press the OK button on the Edit Metadata dialogs, so you should not normally need to run the option to get them backed up.

That is intended primarily for use on old libraries that pre-date the existence of the OPF files in a Calibre library, and IS deliberately designed to run at a limited pace so that the function could be run as a background job without severely affecting performance of Calibre in the foreground.
itimpi is offline   Reply With Quote
Advert
Old 07-03-2012, 06:02 PM   #3
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
I changed some templates around in the custom columns and those haven't been propagated to the OPF backups. I know that generating the OPF is usually done in the background and is designed to use as little system resource as possible but in my case (multiple libraries with 500-15,000 ebooks each), I would prefer to have the option to run it in the foreground (or have a CLI utility that can do it) and practically lock up my system in exchange for finishing the task much faster.
ilovejedd is offline   Reply With Quote
Old 07-04-2012, 12:10 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-debug -c "from calibre.library import db; db = db('/path/to/library'); db.dump_metadata(db.all_ids())"
kovidgoyal is offline   Reply With Quote
Old 07-04-2012, 12:48 PM   #5
ilovejedd
hopeless n00b
ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.ilovejedd ought to be getting tired of karma fortunes by now.
 
ilovejedd's Avatar
 
Posts: 5,110
Karma: 19597086
Join Date: Jan 2009
Location: in the middle of nowhere
Device: PW4, PW3, Libra H2O, iPad 10.5, iPad 11, iPad 12.9
Quote:
Originally Posted by kovidgoyal View Post
calibre-debug -c "from calibre.library import db; db = db('/path/to/library'); db.dump_metadata(db.all_ids())"
Awesome, thanks!
ilovejedd is offline   Reply With Quote
Advert
Old 07-04-2012, 04:49 PM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,440
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
It is worth noting that as of the latest release (or thereabouts), composite custom column templates are saved in the metadata_db_prefs_backup.json file every time you exit the calibre gui. This file is used by restore to rebuild the custom columns, as well as to restore a lot of other things like saved searches, user categories, plugboards, grouped search terms, custom template functions, and several library-level preferences.

The custom column descriptions in the metadata.opf files are used only if the metadata_db_prefs_backup.json is missing or corrupted.
chaley is offline   Reply With Quote
Old 08-29-2013, 03:53 PM   #7
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Calibre-debug: can't downgrade SHLock object (Error Code: 1)

Quote:
Originally Posted by kovidgoyal View Post
calibre-debug -c "from calibre.library import db; db = db('/path/to/library'); db.dump_metadata(db.all_ids())"
Using the 64 byte Win 7 version of Calibre 1.0.0, I receive the following errors whenever I try to use calibre-debug to dump the .opf files for my 26GB 32,000 epub library using Kovid's code snippet from this thread. I have tried both with and without Calibre running simultaneously, but to no avail. Any ideas as to the cause of the SHLock error? Thanks in advance for your help.

C:\Program Files\Calibre2>calibre-debug.exe -c "from calibre.library import db;
db = db('C:\Users\Public\Public eBooks\Calibre2'); db.dump_metadata(db.all_ids()
)"

Python function terminated unexpectedly
can't downgrade SHLock object (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\debug.py", line 231, in main
File "<string>", line 1, in <module>
File "site-packages\calibre\db\legacy.py", line 348, in dump_metadata
File "site-packages\calibre\db\cache.py", line 55, in ans
File "site-packages\calibre\db\cache.py", line 1012, in dump_metadata
File "site-packages\calibre\db\legacy.py", line 146, in all_ids
File "site-packages\calibre\db\cache.py", line 54, in ans
File "site-packages\calibre\db\locking.py", line 212, in __enter__
File "site-packages\calibre\db\locking.py", line 83, in acquire
File "site-packages\calibre\db\locking.py", line 153, in _acquire_shared
calibre.db.locking.LockingError: can't downgrade SHLock object
DaltonST is offline   Reply With Quote
Old 08-29-2013, 10:27 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
For version 1.0 and newer, use this code instead:

calibre-debug -c "from calibre.library import db; db = db('/home/kovid/test library'); db.dump_metadata(tuple(db.all_ids()))"
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom metadata in archived/backup books? PatNY Library Management 14 03-29-2012 06:50 PM
metadata backup silverraven Calibre 3 03-06-2012 07:56 PM
Metadata Backup? Mountainjack Calibre 2 07-17-2011 04:42 PM
How to speed up "Downloading Metadata/Covers"? butterbescotch Calibre 4 05-04-2011 09:58 PM
[Metadata Download Plugin] Goodreads Metadata **Deprecated** kiwidude Plugins 30 04-23-2011 02:10 PM


All times are GMT -4. The time now is 10:49 AM.


MobileRead.com is a privately owned, operated and funded community.