Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 03-01-2019, 02:33 PM   #1
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Running calibredb from a cron script (SOLVED)

Complete newbee in the use of calibredb.

Simple question: I want to run a calibredb list -f ...... once a month from a cron job to generate an up-to-date csv list of all my books.

Do I need to run calibre-server before running calibredb ?
and is there somewhere a howto to guide the hesitant newbees ?

Last edited by rolgiati; 03-03-2019 at 09:54 AM. Reason: Marking as solved
rolgiati is offline   Reply With Quote
Old 03-01-2019, 03:34 PM   #2
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: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
You don't have to run calibre_server to use calibredb, see ==>> calibredb command

Quote:
calibredb can be used to manipulate either a calibre database specified by a path or a calibre Content server running either on the local machine or over the internet
BR

Last edited by BetterRed; 03-01-2019 at 03:36 PM.
BetterRed is offline   Reply With Quote
Advert
Old 03-01-2019, 03:58 PM   #3
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Thanks; that's just what I needed.
rolgiati is offline   Reply With Quote
Old 03-02-2019, 03:11 PM   #4
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Again running calibredb from a cron script (SOLVED)

I am looking for an answer to either of the following two questions:

When running calibredb catalog is there a way torestrict the fields listed in the output ?

OR

When running calibredb list -f "authors, title, series" is there a way to avoid the fields in the output being padded with spaces to a fixed length, and the lines prefixed with a reference number ?

Last edited by rolgiati; 03-03-2019 at 09:53 AM. Reason: Marking as solved
rolgiati is offline   Reply With Quote
Old 03-02-2019, 04:37 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,809
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
id is the reference number in Calibre the matches a specific line item
theducks is offline   Reply With Quote
Advert
Old 03-02-2019, 05:29 PM   #6
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 12,168
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
See the manual https://manual.calibre-ebook.com/gen...calibredb.html
PeterT is offline   Reply With Quote
Old 03-03-2019, 03:58 AM   #7
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Quote:
Originally Posted by PeterT View Post
Thank you for our kind help, but I have already read that page carefully before asking my questions, and I did not see there anything that answers them.

Maybe I'll have to stick with calibredb list, followed by a sed job to remove the unwanted padding spaces....
rolgiati is offline   Reply With Quote
Old 03-03-2019, 04:43 AM   #8
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: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by rolgiati View Post
Thank you for our kind help, but I have already read that page carefully before asking my questions, and I did not see there anything that answers them.
@rogliati - you couldn't have read it very carefully. Had you, then you would have seen that the list sub-command has a --separator option, and that the --machine-readable option will give you a json file.

I don't know anything about the catalog sub command. But if it's like the one in the GUI then I think it's aimed at producing glossy presentation catalogues with cover images, fancy typesetting etc.

BR

Last edited by BetterRed; 03-03-2019 at 06:41 AM.
BetterRed is offline   Reply With Quote
Old 03-03-2019, 07:55 AM   #9
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Quote:
Originally Posted by BetterRed View Post
@rogliati - you couldn't have read it very carefully. Had you, then you would have seen that the list sub-command has a --separator option, and that the --machine-readable option will give you a json file.
I have read it very carefully; but found that the --for-machine (not --machine-readable) option outputs a file with on line for each field of the book; useless for my need, which is to get a file I can multiply grep to get a list of all the books that have the different words anywhere in title, authors or series.
Mind that the --separator is ignored when --for-machine is used.

Quote:
Originally Posted by BetterRed View Post
I don't know anything about the catalog sub command. But if it's like the one in the GUI then I think it's aimed at producing glossy presentation catalogues with cover images, fancy typesetting etc.
The catalog option is completely different from that of the GUI, it outputs a csv file with all the fields of a book on one line.
Still I might go that way, with an awk job to remove all the unwanted fluff.

So although our help did not, thank you for taking the time.

PS I am rolgiati...
rolgiati is offline   Reply With Quote
Old 03-03-2019, 08:20 AM   #10
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: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb catalog test.csv --fields=title,authors

For more information:

calibredb catalog test.csv --help
kovidgoyal is offline   Reply With Quote
Old 03-03-2019, 09:52 AM   #11
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Quote:
Originally Posted by kovidgoyal View Post
calibredb catalog test.csv --fields=title,authors
For more information:
calibredb catalog test.csv --help
Thank you kind sir, that did it perfectly.
Just adding now a mixture of sed, grep, sort and awk jobs to modify the formatting, and I'll have what I wanted / needed.

Something like
Code:
sed 's/,\"\"//p'| sed 's/\",\"/ \# /p' | sed 's/\",\"/ \/ /gp'| sed 's/\"//gp' | sort -u  | grep -v authors | awk -F# '{print $2}' > Catalog$LIB
seems to work well.
rolgiati is offline   Reply With Quote
Old 03-05-2019, 10:24 AM   #12
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Yet again running calibredb from a cron script

Now that my script is running as wished to produce the catalog files I wanted, a new problem has arisen:

For the calibredb-based script to run, calibre must not be running.

So just in case it is running when the cron-job is launched, I have tried to stop it from the script, with pkill calibre, pkill /opt/calibre/bin/calibre, etc run either as user or as root. only pkill /opt/calibre/bin/calibre-parallel stopped something, nothing else works.

Any idea ?
rolgiati is offline   Reply With Quote
Old 03-05-2019, 03:58 PM   #13
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: 20,575
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
try calibre -s

And try RingTFM for heaven's sake

Moderator Notice
I merged your three threads so that anyone coming along later can read the saga of cron and calibre in one fell swoop.


BR

Last edited by BetterRed; 03-05-2019 at 04:07 PM.
BetterRed is offline   Reply With Quote
Old 03-05-2019, 04:43 PM   #14
rolgiati
Groupie
rolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the endrolgiati knows the complete value of PI to the end
 
Posts: 164
Karma: 31650
Join Date: May 2011
Location: Asuncion (Paraguay)
Device: Several Kindle 3 KB's
Quote:
Originally Posted by BetterRed View Post
try calibre -s
Perfect, ta
rolgiati is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calibredb cannot add with content server running apiontek Calibre 10 08-04-2017 04:50 AM
Calibredb not working when GUI is running webdjoe Calibre 9 07-26-2017 04:29 AM
CalibreDB not running on my environment JackED42 Devices 4 10-03-2016 02:25 AM
Running multiple calibredb add jobs simultaneously. AVaughan Library Management 3 10-18-2015 10:16 AM
Option for 'calibredb' to *not* notify a running Calibre GUI? mbovenka Development 4 11-08-2012 04:30 AM


All times are GMT -4. The time now is 10:37 PM.


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