04-13-2024, 07:47 PM | #1 |
Member
Posts: 24
Karma: 106
Join Date: Dec 2010
Location: Ottawa
Device: Kobo WiFi
|
Linux running gui and using calibredb at the same time
In part for the fun and challenge of learning how Linux and bash scripting works, I've set up a Raspberry pi, installed Calibre and set up the content server to run at bootup (no GUI) with a single library. I have a "Autoadd" folder on the Pi (shared on the network through SAMBA) along with a crontab running every 3 minutes that checks the folder for files and, if it finds any, runs a script that, along with some basic checking and logging, does this:
calibredb add --with-library=/home/calibre/Calibre_Library/ --recurse /home/calibre/AutoAdd/ and then archives the added files in a backup folder. I can remotely (SSH) check the status, view the logs, toggle the crontab off/on, stop/start the server etc through a script I wrote. Over all it works great! From any computer (and phone) in the house I can drop books into the folder and at most 3 minutes later they appear in the library through the content server. I use NordVPN's MeshNet so all this is also available external to my network. So what's my question? If I have the gui open on the Pi and run the calibredb add, I get the following: Another calibre program such as calibre-server or the main calibre program is running. Having multiple programs that can make changes to a calibre library running at the same time is a bad idea. calibredb can connect directly to a running calibre Content server, to make changes through it, instead. See the documentation of the --with-library option for details. I understand the basis of this (multi users on the DB) but am wondering how much of an issue is it really under my circumstances? My Add Books script currently checks if the GUI is open and will not run the 'calibredb add' if it is. Although my intention is not to have the gui up on the Pi often, I'm wondering, given the fairly limited environment how likely is running a Command Line calibredb (especially only adding a few books), problems will result? My instinct is to allow the background add to occur regardless of whether the gui is open on the Pi. EDIT: I think I was confused during testing and it looks like the Calibredb WILL NOT add the new book(s) when the GUI is open anyway. Not sure if there is a way to force it to ignore the warning and process the new books. Thanks Last edited by razmichael; 04-13-2024 at 08:42 PM. |
04-13-2024, 11:07 PM | #2 |
creator of calibre
Posts: 44,546
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Run the content server in the gui, then have calibredb connect to the server, and you can add books and do other operations. See the docs for calibredb on how to specify a server to connect to.
|
04-13-2024, 11:39 PM | #3 |
Member
Posts: 24
Karma: 106
Join Date: Dec 2010
Location: Ottawa
Device: Kobo WiFi
|
[EDIT]: Solved the 'issue'. As the current crontab (runs every 3 minutes) checks if the GUI is open and does not even try to run calibredb to add any files found in the autoadd folder, this can continue to run (without trying to add anything) even when the GUI is open. By setting up the GUI to use the same autoadd folder it means that either way (no gui, running silent/headless, VNC window and running the GUI ...), any books dropped in the folder will be added - just by one or the other mechanisms. So basically a seamless adding of books from any authorized device.[End EDIT]
Thanks for the response. The goal is to rarely have the GUI up unless really needed (VNC into the Pi) while the scripting along with calibredb will add any books in the background that are dropped in this network shared directory/folder. As it looks like there is no way to "tell" calibredb to ignore the "another calibre program is..." warning and continue to add books (if found) I'll just let the background process continue but it will skip any new books until the GUI is closed (what I do now). Other than this minor limitation, the process works great anyway - put a book in the folder from anywhere conputers, phone, outside the home network for devices with authorization) and a few minutes later it is readable with the web interface. Thanks for all your work with Calibre. Last edited by razmichael; 04-14-2024 at 03:03 PM. Reason: New Information |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibredb not working when GUI is running | webdjoe | Calibre | 9 | 07-26-2017 05:29 AM |
CalibreDB not running on my environment | JackED42 | Devices | 4 | 10-03-2016 03:25 AM |
Calibre-server / Linux don't see calibreDB update when it's running | aurigod | Calibre | 13 | 11-25-2015 03:44 AM |
Option for 'calibredb' to *not* notify a running Calibre GUI? | mbovenka | Development | 4 | 11-08-2012 05:30 AM |
calibredb set_custom GUI question | Sabkor | Library Management | 4 | 03-12-2011 09:51 PM |