View Single Post
Old 04-13-2024, 06:47 PM   #1
razmichael
Member
razmichael doesn't litterrazmichael doesn't litter
 
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 07:42 PM.
razmichael is offline   Reply With Quote