Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-29-2016, 12:43 AM   #1
CRussel
(he/him/his)
CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.
 
CRussel's Avatar
 
Posts: 12,287
Karma: 80074820
Join Date: Jul 2010
Location: Sunshine Coast, BC
Device: Oasis (Gen3),Paperwhite (Gen10), Voyage, Paperwhite(orig), iPad Air M3
Is there a way to reload database?

Is there a simple way to tell calibre to reload it's database? Preferably from the command line? I use a central calibre database, and server up content internally here. PCs connect directly to the share, and never stay loaded except when actually managing the library, and then only one at a time. But calibre runs natively on the NAS (Windows Storage Server), serving up to tablets and kindles. (Tablets with calibre-companion, my kindle with the web server.)

The problem is the NAS doesn't know the database has changed, so often has a stale view. It would be nice to have a simple calibre-server command to reload the database. Right now I have to RDP in to the NAS, stop calibre and restart it. A simple way to do this from the command line would be really appreciated, since I can easily get a remote command line with PowerShell.
CRussel is offline   Reply With Quote
Old 04-29-2016, 01:53 AM   #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,252
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre-server auto-reloads whenever the last modified date of metadata.db is changed.
kovidgoyal is offline   Reply With Quote
Advert
Old 05-03-2016, 09:18 PM   #3
CRussel
(he/him/his)
CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.
 
CRussel's Avatar
 
Posts: 12,287
Karma: 80074820
Join Date: Jul 2010
Location: Sunshine Coast, BC
Device: Oasis (Gen3),Paperwhite (Gen10), Voyage, Paperwhite(orig), iPad Air M3
Not so far as I can tell. I know the underlying database has changed, but it isn't seen by the running Calibre.
CRussel is offline   Reply With Quote
Old 05-03-2016, 09:31 PM   #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,252
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I am talking about the standalone calibre server, calibre-server.exe on every http request it checks if the db was changed and reloads it if so:

https://github.com/kovidgoyal/calibr...r/utils.py#L53
kovidgoyal is offline   Reply With Quote
Old 05-03-2016, 09:38 PM   #5
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)
Why do you need to RDP in to reload the server -- the server is a CLI tool anyway.

Are you referring to the GUI by any chance?

...

On the topic of the server, if it was updated by a delete+relink, then calibre-server will hold the old file open I believe -- this is apparently a problem with Dropbox.

Last edited by eschwartz; 05-03-2016 at 09:40 PM.
eschwartz is offline   Reply With Quote
Advert
Old 05-04-2016, 12:47 AM   #6
CRussel
(he/him/his)
CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.
 
CRussel's Avatar
 
Posts: 12,287
Karma: 80074820
Join Date: Jul 2010
Location: Sunshine Coast, BC
Device: Oasis (Gen3),Paperwhite (Gen10), Voyage, Paperwhite(orig), iPad Air M3
I stand corrected. I was running the gui, though I only did it to load the content server. And apparently, that interfered with the database reload functionality. However, when I start up the content server by itself, it behaves as you describe. (I could wish it exited the command line (released the shell) and ran as a background process, but I can live with it. )
CRussel is offline   Reply With Quote
Old 05-04-2016, 01:21 AM   #7
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)
The GUI expects exclusive permission to write to the database -- for obvious reasons!
The server is a passive read-only process, so it is feasible to reload the database automatically.

As for releasing the shell, I use calibre-server via a linux systemd service. Presumably Windows has a way to create your own system services as well, and unlike me, you might have a clue how to do that.
eschwartz is offline   Reply With Quote
Old 05-04-2016, 05:44 AM   #8
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,661
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by CRussel View Post
I could wish it exited the command line (released the shell) and ran as a background process, but I can live with it.
I know of someone who runs calibre-server as a service via Always-up. I use FireDeamon for running other things as a service, not tried it with calibre-server, should work too..

NT used to have something to do this, forget its name (servstart maybe), but it hasn't worked since Vista

Added : maybe it didn't come with NT, there's a 3rd party program called SrvStart that looks familiar. and it runs on post Vista Windows, see ==>> HTG - Run Any Program as a Background Service in Windows

BR

Last edited by BetterRed; 05-04-2016 at 06:55 AM.
BetterRed is offline   Reply With Quote
Old 05-04-2016, 08:49 AM   #9
CRussel
(he/him/his)
CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.CRussel ought to be getting tired of karma fortunes by now.
 
CRussel's Avatar
 
Posts: 12,287
Karma: 80074820
Join Date: Jul 2010
Location: Sunshine Coast, BC
Device: Oasis (Gen3),Paperwhite (Gen10), Voyage, Paperwhite(orig), iPad Air M3
I'll have to try it as a PowerShell job. That should work. Didn't think of it last night.
CRussel is offline   Reply With Quote
Old 05-14-2016, 09:00 AM   #10
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,056
Karma: 54671821
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by eschwartz View Post
Why do you need to RDP in to reload the server -- the server is a CLI tool anyway.

Are you referring to the GUI by any chance?

...

On the topic of the server, if it was updated by a delete+relink, then calibre-server will hold the old file open I believe -- this is apparently a problem with Dropbox.
Hmmm...I didn't realize that the content server was a CLI tool. I always thought that the GUI had to be running in order to have the content server run. I was going by this sentence in the preferences-->sharing window "Remember to leave calibre running as the server only runs as long as calibre is running" Did this change recently? If it did, maybe that sentence should be removed?

Shari
shalym is offline   Reply With Quote
Old 05-14-2016, 09:50 AM   #11
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: 30,942
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 shalym View Post
Hmmm...I didn't realize that the content server was a CLI tool. I always thought that the GUI had to be running in order to have the content server run. I was going by this sentence in the preferences-->sharing window "Remember to leave calibre running as the server only runs as long as calibre is running" Did this change recently? If it did, maybe that sentence should be removed?

Shari
Many parts of Calibre are available as both.
theducks is offline   Reply With Quote
Old 05-14-2016, 10:50 AM   #12
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,056
Karma: 54671821
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by theducks View Post
Many parts of Calibre are available as both.
I understand that. I'm just saying that the sentence in question contradicts what was said by eschwartz, and if that sentence is, in fact wrong, maybe it should be changed.

I've added a bug report/feature request asking for the sentence to be changed.

Shari
shalym is offline   Reply With Quote
Old 05-15-2016, 01:22 AM   #13
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)
That sentence is entirely true for the GUI.

calibre, due to its linux heritage, has a pretty complete CLI backend which can replicate most/all of the GUI functionality.
As such, the server can be started on its own via a CLI executable, which naturally enough stays alive as long as that CLI executable process is running -- which is to say, it is decoupled from the library GUI.

re: your bugreport, the sentence in Preferences is not actually wrong, nor does it contradict what I said.
That being said, if you are saying it should be enhanced to notify users that the CLI alternative allows you to close calibre and leave the server running, I guess I can hear that (although I don't know how many people would actually be willing to do so and therefore benefit from the doc change -- most prospective CLI users already know ).
eschwartz is offline   Reply With Quote
Old 05-15-2016, 07:24 AM   #14
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,056
Karma: 54671821
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by eschwartz View Post
That sentence is entirely true for the GUI.

calibre, due to its linux heritage, has a pretty complete CLI backend which can replicate most/all of the GUI functionality.
As such, the server can be started on its own via a CLI executable, which naturally enough stays alive as long as that CLI executable process is running -- which is to say, it is decoupled from the library GUI.

re: your bugreport, the sentence in Preferences is not actually wrong, nor does it contradict what I said.
That being said, if you are saying it should be enhanced to notify users that the CLI alternative allows you to close calibre and leave the server running, I guess I can hear that (although I don't know how many people would actually be willing to do so and therefore benefit from the doc change -- most prospective CLI users already know ).
My point is that not all do, or else we wouldn't be having this conversation.

What about changing the sentence to something like: "Remember to leave calibre running as the server only runs as long as calibre is running. If you do wish to run the server as a standalone entity, please see the documentation on how to run from the command line"

...or something like that. I'm not sure of the word "entity", and maybe you want to point to the part of the documentation that discusses running calibre-server.exe?

Shari
shalym is offline   Reply With Quote
Old 05-16-2016, 12:59 AM   #15
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)
Documentation updated: https://github.com/kovidgoyal/calibr...b1c1a7afe05a6a
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a Reload plugin frisket Plugins 1 03-26-2014 05:57 PM
Request: Reload Device Button CRussel Calibre 0 11-02-2013 05:11 PM
Reload not working? sunfish62 Kindle Fire 5 01-20-2012 01:30 PM
Reload file size ptom Library Management 10 03-28-2011 02:10 PM
Reload The Matrix Saud Lounge 6 06-02-2003 05:01 PM


All times are GMT -4. The time now is 05:15 PM.


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