View Single Post
Old 08-27-2013, 11:55 AM   #6
josh.p.23
Member
josh.p.23 began at the beginning.
 
josh.p.23's Avatar
 
Posts: 18
Karma: 12
Join Date: Aug 2013
Device: android kindle app, FB Reader, several tablets
clarification...

Just to be sure I got this,

1) when Calibre opens the database to read on the server, even though it is not writing to the database file, it locks the file so that it cannot be written to, making syncing a pain

2) to get around this, you can either
a) manually stop the calibre-server, sync, and restart it or
b) use the method which you outlined above

Using monit is nice and hands off. Ok, so that effectively makes it so that

1) when Calibre-server restarts, it copies the metadata.db to /temp, and reads it from there, leaving the "original" database unopened, and therefore unlocked and writable, syncable.

2) whenever the original database (on the server) is altered (synced up from the remote database on the laptop or home desktop installation of Calibre using dropbox, ubuntu one, rsync, Unison, or whatever), monit detects the timestamp alteration and restarts calibre, copying the new databse to temp, replacing the old there.

I got this Thank you for pointing that out, I did not recognize that in the post.
josh.p.23 is offline   Reply With Quote