![]() |
#1 |
(he/him/his)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
(he/him/his)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
(he/him/his)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. )
|
![]() |
![]() |
![]() |
#7 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. ![]() |
![]() |
![]() |
![]() |
#8 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,661
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#9 |
(he/him/his)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
Shari |
|
![]() |
![]() |
![]() |
#11 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
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 |
![]() |
![]() |
![]() |
#13 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 ![]() |
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
![]() 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 |
|
![]() |
![]() |
![]() |
#15 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |