Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-12-2020, 07:16 PM   #1
cmartin616
Junior Member
cmartin616 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2020
Device: none
Ubuntu Server 18.04 can't seem to change metadata.db location

Hello,

I am using Calibre to warehouse my ebooks on Ubuntu Server 18.04. I am not using Calibre Content Server to read via the web as I am using Calibre-Web for that purpose. I've noticed Calibre-Web being quite slow so I dug around a bit and realized Calibre creates the metadata.db database in the same location as the library. However, my library is on a NAS and I don't want the metadata.db to co-locate as I'd prefer it be local to Calibre. I've tried all sorts of methods to set the environmental variables but I can't seem to get Calibre (via GUI) or calibredb to recognize the CALIBRE_OVERRIDE_DATABASE_PATH or CALIBRE_CONFIG_DIRECTORY variable. I've tried setting it in /etc/environment. I've tried setting it in ~/.profile. I've tried creating a shell script to export CALIBRE_OVERRIDE_DATABASE_PATH prior to loading the GUI. I've always tried logging out/in after these changes. Nothing works.

More specifics:
  • Calibre is installed within the main OS/default locations originally by a headless user that no longer exists. (/opt/calibre and owned by root:root)
  • Calibre-Web is run in a Docker container with a dedicated user and group. This user is a service account with no home.
  • LazyLibrarian is run in a Docker container with a different dedicated user and group. This user is a service account with no home.
  • My library is located on my NAS. I have this drive mounted in Ubuntu. The mount directories are owned by a number and the group users. I believe this is because of the way they are mounted via fstab.
  • Calibre has a single library pointing at the NAS and can read/write.
  • Calibre-Web and LazyLibrarian can read/write to the NAS as well.
  • Calibre's config directory (via GUI) is my admin user's .profile directory. Does this get created when the GUI is run by a user?
  • calibredb says there is no saved library path when run as any user except my admin user. LazyLibrarian import does nothing (I assume due to this same library path issue). The LazyLibrarian Docker shell recognizes calibredb but, again, no saved library path.

Ideally, I'd like to move the metadata.db onto a Ubuntu machine (/opt/calibre-config/data). I'd also like to move the configs (/opt/calibre-config/config) to a general location that would be readable by the necessary users. Does anyone have a documented procedure that can help me resolve these issues?

Thanks!
cmartin616 is offline   Reply With Quote
Old 05-12-2020, 08:01 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: 2,181
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by cmartin616 View Post
Hello,

I am using Calibre to warehouse my ebooks on Ubuntu Server 18.04. I am not using Calibre Content Server to read via the web as I am using Calibre-Web for that purpose. I've noticed Calibre-Web being quite slow so I dug around a bit and realized Calibre creates the metadata.db database in the same location as the library. However, my library is on a NAS and I don't want the metadata.db to co-locate as I'd prefer it be local to Calibre. I've tried all sorts of methods to set the environmental variables but I can't seem to get Calibre (via GUI) or calibredb to recognize the CALIBRE_OVERRIDE_DATABASE_PATH or CALIBRE_CONFIG_DIRECTORY variable. I've tried setting it in /etc/environment. I've tried setting it in ~/.profile. I've tried creating a shell script to export CALIBRE_OVERRIDE_DATABASE_PATH prior to loading the GUI. I've always tried logging out/in after these changes. Nothing works.

More specifics:
Spoiler:
  • Calibre is installed within the main OS/default locations originally by a headless user that no longer exists. (/opt/calibre and owned by root:root)
  • Calibre-Web is run in a Docker container with a dedicated user and group. This user is a service account with no home.
  • LazyLibrarian is run in a Docker container with a different dedicated user and group. This user is a service account with no home.
  • My library is located on my NAS. I have this drive mounted in Ubuntu. The mount directories are owned by a number and the group users. I believe this is because of the way they are mounted via fstab.
  • Calibre has a single library pointing at the NAS and can read/write.
  • Calibre-Web and LazyLibrarian can read/write to the NAS as well.
  • Calibre's config directory (via GUI) is my admin user's .profile directory. Does this get created when the GUI is run by a user?
  • calibredb says there is no saved library path when run as any user except my admin user. LazyLibrarian import does nothing (I assume due to this same library path issue). The LazyLibrarian Docker shell recognizes calibredb but, again, no saved library path.

Ideally, I'd like to move the metadata.db onto a Ubuntu machine (/opt/calibre-config/data). I'd also like to move the configs (/opt/calibre-config/config) to a general location that would be readable by the necessary users. Does anyone have a documented procedure that can help me resolve these issues?


Thanks!
Start here:

https://manual.calibre-ebook.com/faq...rked-drive-nas

Pay attention to the third paragraph that starts with "If you must...."

bernie
gbm is offline   Reply With Quote
Advert
Old 05-12-2020, 09:34 PM   #3
cmartin616
Junior Member
cmartin616 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2020
Device: none
Thanks Bernie. My issue does not seem to be addressed by the FAQ other than a blanket NAS is bad. I agree having the database on the NAS isn't great and that is why I am trying to move it.

However, the pattern of requiring the media files to live on the actual device doesn't make sense to me. I've used my NAS as my primary media storage (RAID 0, configured to backup off-site) with LazyLibrarian and Calibre for years. It is only recently that I've begun to consolidate config locations and permissions. I don't have any of the issues listed in the FAQ. The only thing I want to do is move the location metadata.db and config directories, as indicated by this doc:

https://manual.calibre-ebook.com/customize.html

There should be no reason why Calibre can't read the database locally and reference shared directories for the files like any other media management software (Radarr, Sonarr, Plex, etc.). It is inconceivable that managing three dozen 1mb *.epub and associated metadata (which doesn't change) is so taxing that it can't compete with on-the-fly 1080p transcoding of a 10gb video off the same share and sharing paradigm. What am I missing here?
cmartin616 is offline   Reply With Quote
Old 05-12-2020, 10:45 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,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The environment variables work, as documented. If they aren't working for you then you aren't setting them.
kovidgoyal is offline   Reply With Quote
Old 05-13-2020, 08:06 AM   #5
cmartin616
Junior Member
cmartin616 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2020
Device: none
I'm sorry but the documentation doesn't include any references to setting the environment variables in a Linux system. There are many different ways to set env variables in Linux so which does Calibre read from? It does not appear to respect /etc/environment. Calibredb is being run from a service account with no home so I can't set ~/.profile.

Something works as intended is great. Not documenting how something works and when a user asks for assistance, its unfortunate the response is simply - it works as intended and you are the problem.

I can't believe the amount of push back in this forum when people are requesting help. I've tried to be very clear in my asks and the responses don't seem to indicate I've conveyed my ask well. If you could help me clarify on what aspects I am leaving out, I'd gladly update with the information.

To clarify, I am asking exactly where I set Ubuntu environmental variables that will be used by both a service account running calibredb *and* an admin user (me) running the Calibre GUI.

Thank you.
cmartin616 is offline   Reply With Quote
Advert
Old 05-13-2020, 08:23 AM   #6
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: 2,181
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by cmartin616 View Post
I'm sorry but the documentation doesn't include any references to setting the environment variables in a Linux system. There are many different ways to set env variables in Linux so which does Calibre read from? It does not appear to respect /etc/environment. Calibredb is being run from a service account with no home so I can't set ~/.profile.

Something works as intended is great. Not documenting how something works and when a user asks for assistance, its unfortunate the response is simply - it works as intended and you are the problem.

I can't believe the amount of push back in this forum when people are requesting help. I've tried to be very clear in my asks and the responses don't seem to indicate I've conveyed my ask well. If you could help me clarify on what aspects I am leaving out, I'd gladly update with the information.

To clarify, I am asking exactly where I set Ubuntu environmental variables that will be used by both a service account running calibredb *and* an admin user (me) running the Calibre GUI.

Thank you.

https://help.ubuntu.com/community/EnvironmentVariables
bernie
gbm is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
installing Calibre content server 3 on ubuntu server 16_04 khyox Calibre 22 01-06-2018 11:34 PM
Calibre-server ubuntu server GeekNbOne Calibre 1 10-03-2017 09:52 PM
Server Log Location Archon Calibre 8 11-15-2015 03:54 AM
Content server on ubuntu 12.04 headless server ImageMagick: libltdl.so.7 Cool Javelin Calibre 5 04-08-2015 02:20 AM
Is it possible to change Calibre-Server.exe to change to a service for Windows roadrunnerm Calibre 1 10-19-2012 06:44 PM


All times are GMT -4. The time now is 09:57 PM.


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