Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-19-2014, 06:33 AM   #1
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
Question Need help with calibre-server

Dear you guys,

I'm using calibre-server to run a synced database on a always-online computer.
Code:
calibre-server --with-library "my_library" -p xxxx --auto-reload -t 120
It works. . The server runs fine. But the database file is locked by calibre-server (I think) and can not get updated automatically when the origin is updated (from my laptop). I had to manually stop the script, and the file gets synced.

It is a windows 7 PC. Is there away for the database to be released automatically and get updated? I'm not sure what the "-auto-reload" and -t timeout is for.
nqk is offline   Reply With Quote
Old 07-19-2014, 07:19 AM   #2
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,355
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
--auto-reload is for development. Since windows locks all open files your only way around is to stop the server, do the syn and start the server. Or use a linux/os x computer to run the server, where there is no locking problem.
kovidgoyal is offline   Reply With Quote
Old 07-22-2014, 03:57 AM   #3
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
Thanks for confirmation. But I have no other machines. Anyway, I set up two windows schedules, which are repeated every hour (maybe longer when I don't edit the database much)
1) Kill calibre-server
(wait 5 minutes for all files to be synced automatically)
2) Run calibre-server.

This means that the server is offline 5 minutes every hour, , but I can live with that.

//
PS: I use Bittorrent Sync, so the sync is quite fast.
nqk is offline   Reply With Quote
Old 07-22-2014, 04:31 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
What I do is have a script (monit on linux) that watches the timestamp of the calibre database file in the sync'ed folder (dropbox for me). If the timestamp changes then monit runs a script to restart calibre.

My calibre restart script kills calibre, copies the database file to /tmp, sets the environment variable CALIBRE_OVERRIDE_DATABASE_PATH to that new copy, then starts calibre. Total calibre-off time is seconds.

This technique ensures that the database file in the sync folder is open only for as long as it takes to make a copy, reducing sync failures to almost zero. A failure can still happen, but it would require two syncs within the monitoring window of the script.

I don't know what you would use to watch timestamps on a windows system.
chaley is offline   Reply With Quote
Old 07-22-2014, 05:22 AM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
I don't know what you would use to watch timestamps on a windows system.
I use a program called Watch 4 Folder- the free version is limited to watching one folder/file, the Pay4Me version (USD5.00) can watch 4?

Be careful with the install it has a 'free offer'

BR
BetterRed is offline   Reply With Quote
Old 07-22-2014, 11:19 PM   #6
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
In my case watching for timestamp change is not helpful because the metadata.db is locked by existing calibre-server.exe instance and it is not updated by other software (bitsync for me).

I then need to have calibre-server.exe automatically killed (by windows task scheduler), then during the five minutes while calibre-server.exe is not running, the metadata.db file is free for updating (if any), then calibre-server.exe is automatically called for running again (for 55 minutes now).

I know it sounds and is unprofessional and newbie, but that's all I can do. . Please teach me a better alternative. I only have a windows pc

Last edited by nqk; 07-22-2014 at 11:24 PM.
nqk is offline   Reply With Quote
Old 07-23-2014, 01:29 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by nqk View Post
In my case watching for timestamp change is not helpful because the metadata.db is locked by existing calibre-server.exe instance and it is not updated by other software (bitsync for me).

I then need to have calibre-server.exe automatically killed (by windows task scheduler), then during the five minutes while calibre-server.exe is not running, the metadata.db file is free for updating (if any), then calibre-server.exe is automatically called for running again (for 55 minutes now).

I know it sounds and is unprofessional and newbie, but that's all I can do. . Please teach me a better alternative. I only have a windows pc
In my post (#4) I told you how to avoid having calibre lock the db.
chaley is offline   Reply With Quote
Old 07-24-2014, 03:56 AM   #8
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf
Calibre-Server.exe and Virtual Library

Thank you all for your responses.

Can I use calibre-server.exe command line to show a certain Virtual Library?

I created a number of virtual libraries and I would like to broadcast each to different ports.
nqk is offline   Reply With Quote
Old 07-24-2014, 04:10 AM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by nqk View Post
Thank you all for your responses.

Can I use calibre-server.exe command line to show a certain Virtual Library?

I created a number of virtual libraries and I would like to broadcast each to different ports.
See the calibre-server documentation at http://manual.calibre-ebook.com/cli/calibre-server.html, and in particular the --restriction argument.
chaley is offline   Reply With Quote
Old 07-24-2014, 11:00 AM   #10
nqk
Fanatic
nqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beautynqk does all things with Zen-like beauty
 
Posts: 564
Karma: 32228
Join Date: Feb 2012
Device: Onyx Boox Leaf


Thank you!
nqk is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting Calibre's built-in web server to a remote server? perryja Related Tools 6 05-02-2013 09:05 AM
calibre-server: Doesn't server up newly added files kaistian Calibre 5 03-17-2013 11:54 AM
calibre-server OPDS catalog - manual move to web server HaakonME Related Tools 5 09-21-2012 03:11 AM
500 Internal Server Error accessing content server Calibre 0.8.8 DaddyO57 Calibre 1 07-20-2012 06:08 PM
Calibre-server port not open issue on Fedora server stueyboy Devices 0 08-17-2011 04:57 PM


All times are GMT -4. The time now is 03:13 PM.


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