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 12-04-2015, 01:03 PM   #1
umbighouse
Junior Member
umbighouse began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2015
Device: Kindle Fire
Check Library CLI not working for me

I'm trying to use the Calibre CLI for the check-library feature to check for new books not yet in the database, and to add them automatically.

Here's the syntax I'm using:

Code:
calibredb check_library --library-path :D:\My Media\eBooks" > "C:\temp\calibreresults.txt"
I'm running this from the Calibre2 folder itself in a command prompt. When I run it (even with elevated Windows privileges), it just hangs forever, and never completes. I only have a few hundred books in my library. Nothing is written to the output file either.

Any ideas?
Thanks in advance.
umbighouse is offline   Reply With Quote
Old 12-04-2015, 01:12 PM   #2
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why aren't you using the check library function in the GUI? The CLI version has no auto add, IIRC, the GUI does.
kovidgoyal is online now   Reply With Quote
Advert
Old 12-04-2015, 01:12 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,057
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by umbighouse View Post
I'm trying to use the Calibre CLI for the check-library feature to check for new books not yet in the database, and to add them automatically.

Here's the syntax I'm using:

Code:
calibredb check_library --library-path :D:\My Media\eBooks" > "C:\temp\calibreresults.txt"
I'm running this from the Calibre2 folder itself in a command prompt. When I run it (even with elevated Windows privileges), it just hangs forever, and never completes. I only have a few hundred books in my library. Nothing is written to the output file either.

Any ideas?
Thanks in advance.
Is that a typo in your post or was this a cut and paste?
theducks is offline   Reply With Quote
Old 12-04-2015, 01:15 PM   #4
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
@umbighouse:

Do yourself a favor and create a .bat file, and run it from that.


Example:

calibredb backup_metadata --all --library-path="S:\Calibre\..."




DaltonST
DaltonST is offline   Reply With Quote
Old 12-04-2015, 02:09 PM   #5
umbighouse
Junior Member
umbighouse began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2015
Device: Kindle Fire
theducks-

Yes, sorry- that looks like a typo. The path is ok in the actual command.

I'd like to run this as a batch file with a scheduled task to regularly check for new books, since I don't always add them from the main computer. This would save me from having to manually use the GUI to update the library each time.

Is it confirmed that the CLI cannot auto add new books found during a scan?
umbighouse is offline   Reply With Quote
Advert
Old 12-04-2015, 02:14 PM   #6
umbighouse
Junior Member
umbighouse began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2015
Device: Kindle Fire
Should the syntax be:

Code:
calibredb check_library --library-path "D:\My Media\eBooks" > "C:\temp\calibreresults.txt"
-or-
Code:
calibredb check_library --library-path="D:\My Media\eBooks" > "C:\temp\calibreresults.txt"
umbighouse is offline   Reply With Quote
Old 12-04-2015, 02:22 PM   #7
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,351
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If you want to auto add books use Preferences->Adding Books->Auto add from folder

If you wan to add books via script, use

calibredb add

*Do not* ever copy files intot he calibre library folder and try to use check/restore library to add them.
kovidgoyal is online now   Reply With Quote
Old 12-04-2015, 02:27 PM   #8
umbighouse
Junior Member
umbighouse began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2015
Device: Kindle Fire
How often is the folder checked to Auto Add new items?

Does "calibredb add" simply scan for new items and add them?

Thanks.
umbighouse is offline   Reply With Quote
Old 12-04-2015, 02:57 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Code:
calibredb add --recurse D:\\ebooks-to-add-to-calibre\\
Does that answer your question?

The auto-add folder is periodically checked in the background while the GUI is running.

Last edited by eschwartz; 12-04-2015 at 04:07 PM.
eschwartz is offline   Reply With Quote
Old 12-04-2015, 03:22 PM   #10
umbighouse
Junior Member
umbighouse began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Dec 2015
Device: Kindle Fire
I tried using
Code:
calibredb add -recurse "D:\My Media\eBooks"
but it just runs and never stops. My db is only 800KB.

What am I missing here? I also just updated to the current 64-bit version, so all files should be up to date.

Are there supposed to be 2 backslashes after the D:\ drive location?
Do you need a backslash at the end of the path?
umbighouse is offline   Reply With Quote
Old 12-04-2015, 04:10 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I fixed a typo above.

The --recurse switch needs two "--".

Paths on Windows are weird, the backslash is an *escape* character, but Windows uses it as a path separator as well. I think it is generally considered better to double them.
A doubled backslash escapes the second one so it is ensured treatment as a literal backslash -- the path separator.
eschwartz is offline   Reply With Quote
Old 12-04-2015, 04:56 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by kovidgoyal View Post
If you want to auto add books use Preferences->Adding Books->Auto add from folder

If you want to add books via script, use

calibredb add

*Do not* ever copy files into the calibre library folder and try to use check/restore library to add them.
Quote:
Originally Posted by umbighouse View Post
How often is the folder checked to Auto Add new items?

Does "calibredb add" simply scan for new items and add them?

Thanks.
@umbighouse - When a file arrives in my auto-add folder and calibre is running, the file is 'added' to the currently open library and removed from the auto-add folder more or less immediately - i.e. in the blink of an eye. If calibre is not running the contents of the auto-add folder are dealt with the next time calibre starts.

I don't know (or care) if calibre 'polls' the folder or uses the equivalent of inotify - but I suspect it maybe the latter.

The downside of using Auto-add is if you have the wrong library open when the file arrives in the auto-add folder then the file will be added to the wrong library.

A 'nice-to-have' refinement would be to have an option to give each library a dedicated auto-add folder (probably with a fixed name) - eg "MyLibrary/$$Autoadd".

BR
BetterRed is offline   Reply With Quote
Old 12-04-2015, 05:24 PM   #13
jecilop
Addict
jecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day nowjecilop will be dicovering the secret to cold fusion any day now
 
Posts: 260
Karma: 139980
Join Date: Mar 2014
Device: Android
hmmm..umm...Kovid...

Quote:
Originally Posted by kovidgoyal View Post
If you want to auto add books use Preferences->Adding Books->Auto add from folder


*Do not* ever copy files intot he calibre library folder and try to use check/restore library to add them.
@KovidGoyal,
See my thread here related to that....

My reply has nothing to do with this thread, but it addresses a question I have that relates to what you said here.

Last edited by jecilop; 12-04-2015 at 05:24 PM. Reason: typ
jecilop is offline   Reply With Quote
Old 12-06-2015, 01:20 AM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
@jecilop,

the difference is if you are willing to lift calibre's skirt and meddle with the structure, you can *probably* trick calibre into linking a new format.

But this thread, and Kovid's comment here, relates to trying to use check/restore library to add a new book record.
Which is much more hopeless unless you get all the details perfect. And creating an OPF yourself is horribly wasteful.
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check not working at all shadowThief Editor 6 06-12-2015 09:04 AM
Saving metadata and covers with the cli interface not working properly Kode Calibre 9 11-09-2014 06:29 PM
Conversion not working in calbre GUI -- CLI OK mfmadden Conversion 8 02-22-2014 04:14 PM
Classic Check for new B&N content not working graddy Barnes & Noble NOOK 1 07-18-2010 09:40 PM


All times are GMT -4. The time now is 10:45 PM.


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