Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-20-2017, 01:25 PM   #1
paperrhino
Junior Member
paperrhino began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2017
Device: Android
Headless server with non-default DB location

I'm experimenting with setting up a headless calibre-server on Ubuntu Server 17.4. I've come a long way but am facing a bit of a problem.

I've got it running as a service but my books are on a file share so I've set the CALIBRE_OVERRIDE_DATABASE_PATH=/home/calibre/metadata.db environment variable so it saves the DB not on the CIFS mounted file system per the warnings in the FAQ.

I've even managed to install and configure one plugin from the command line. so far so good.

My problem is with adding books. When I try to run the following command (with the override DB environment variable correctly set) calibre creates a new metadata.db in the library folder rather than editing the metadata.db that calibre-server is actually using.

Code:
xvfb-run calibredb add /mnt/calibre/toadd/ -r --with-library /mnt/calibre/library
When I list the contents of the newly created /mnt/calibre/library/metadata.db I see only the new books. When I list the contents of the "real" metadata.db I get all the old books and none of the new ones.

Is alternative DB locations not supported by calibredb or am I doing something wrong?

Many thanks.
paperrhino is offline   Reply With Quote
Advert
Old 04-20-2017, 05:38 PM   #2
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,112
Karma: 3620534
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by paperrhino View Post
I'm experimenting with setting up a headless calibre-server on Ubuntu Server 17.4. I've come a long way but am facing a bit of a problem.

I've got it running as a service but my books are on a file share so I've set the CALIBRE_OVERRIDE_DATABASE_PATH=/home/calibre/metadata.db environment variable so it saves the DB not on the CIFS mounted file system per the warnings in the FAQ.

I've even managed to install and configure one plugin from the command line. so far so good.

My problem is with adding books. When I try to run the following command (with the override DB environment variable correctly set) calibre creates a new metadata.db in the library folder rather than editing the metadata.db that calibre-server is actually using.

Code:
xvfb-run calibredb add /mnt/calibre/toadd/ -r --with-library /mnt/calibre/library
When I list the contents of the newly created /mnt/calibre/library/metadata.db I see only the new books. When I list the contents of the "real" metadata.db I get all the old books and none of the new ones.

Is alternative DB locations not supported by calibredb or am I doing something wrong?

Many thanks.
I think you need the share UUID ex:
Code:
/mnt/1589cd3b-4281-4652-af95-1aed1a229bcc
Look in /opt/calibre/resources/ at the contents of calibre-portable.sh.

Edit


Verily the path and that they are mounted of your share using a terminal and the cd and l commands.

The only device I have that does not mount with a UUID is my NOOK.
bernie

Last edited by gbm; 04-20-2017 at 05:54 PM.
gbm is offline   Reply With Quote
Old 04-21-2017, 09:57 AM   #3
paperrhino
Junior Member
paperrhino began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2017
Device: Android
Thank you for your reply. I'm not certain I fully understand what you are asking me to do.

I've looked at calibre-portable.sh and I see where it creates a conf file and in there I see where it sets the CALIBRE_OVERRIDE_DATABASE_PATH which looks a lot like what I'm already doing.

My share is a cifs mounted share so I don't think it has a uuid beyond the //machine/dir path.

And I don't understand how that would help. I wanted to have my books stored in one directory and my metadata.db stored in another. The problem wasn't that calibredb couldn't find the books library folder, it was that it was ignoring the CALIBRE_OVERRIDE_DATABASE_PATH environment variable.

In any case, I determined the big problem with having the library on a network share is trying to run multiple instances of Calibre on the same library. Since I'm only ever going to have this one server putting the library on a network share has minimal risk of corruption for me. So I'm just using the default location for metadata.db for now and it is working just fine.

Now, as I purchase eBooks I can drop them into a toadd folder and a cron job will automatically add them to the Calibre library. Then I can browse and download books through the web or apps like Calibre Companion.

Thanks again for the help.
paperrhino is offline   Reply With Quote
Old 04-21-2017, 10:47 AM   #4
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 1,112
Karma: 3620534
Join Date: Jun 2010
Device: Windows 10 tablet,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Looks to me like you could use calibre-portable.sh to do what you need in setting the variables and changing the line"
Code:
$CALIBRE --with-library "${CALIBRE_LIBRARY_DIRECTORY}"
to
Code:
$CALIBRE-SERVER --with-library "${CALIBRE_LIBRARY_DIRECTORY}"
You have it working that all that matters.
bernie
gbm is offline   Reply With Quote
Old 04-24-2017, 10:24 AM   #5
paperrhino
Junior Member
paperrhino began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Apr 2017
Device: Android
I did review the script and I am doing the exact same thing as the script. I have the CALIBRE_OVERRIDE_DATABASE_PATH environment variable set just as it does in that script and I pass the path to the books using --with-library.

My metadata.db file is not located in the default location, hence my setting of the override environment variable.

calibre-server runs just fine. It uses the metatadata.db file I indicate in the override environment variable and it puts the book files in the directory I indicate in the --with-library flag.

The problem is calibredb seems to ignore the override environment variable. Therefore I cannot add books to my library from the command line when metadata.db is not in the default location.

Thanks for trying to help. I just wanted to make is clear what the problem was in case someone else has the same problem in the future.
paperrhino is offline   Reply With Quote
Reply

Tags
metadata.db calibredb

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversions via headless calibre server? mrdrew Conversion 1 09-07-2016 10:40 PM
Content server on ubuntu 12.04 headless server ImageMagick: libltdl.so.7 Cool Javelin Calibre 5 04-08-2015 02:20 AM
DEBIAN Headless SERVER sMystero Devices 10 04-03-2015 06:55 PM
Headless Calibre Server greene48 Library Management 17 10-28-2013 01:09 AM
Calibre Headless Server dearleuk Library Management 2 12-02-2012 04:04 AM


All times are GMT -4. The time now is 12:40 AM.


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