|  03-01-2019, 02:33 PM | #1 | 
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | 
				
				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 | 
|   |   | 
|  03-01-2019, 03:34 PM | #2 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | 
			
			You don't have to run calibre_server to use calibredb, see ==>> calibredb command  Quote: 
 Last edited by BetterRed; 03-01-2019 at 03:36 PM. | |
|   |   | 
|  03-01-2019, 03:58 PM | #3 | 
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | 
			
			Thanks; that's just what I needed.
		 | 
|   |   | 
|  03-02-2019, 03:11 PM | #4 | 
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | 
				
				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 | 
|   |   | 
|  03-02-2019, 04:37 PM | #5 | 
| Well trained by Cats            Posts: 31,250 Karma: 61360164 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
		 | 
|   |   | 
|  03-02-2019, 05:29 PM | #6 | 
| Grand Sorcerer            Posts: 13,693 Karma: 79983758 Join Date: Nov 2007 Location: Toronto Device: Libra H2O, Libra Colour | 
			
			See the manual https://manual.calibre-ebook.com/gen...calibredb.html
		 | 
|   |   | 
|  03-03-2019, 03:58 AM | #7 | |
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | Quote: 
 Maybe I'll have to stick with calibredb list, followed by a sed job to remove the unwanted padding spaces.... | |
|   |   | 
|  03-03-2019, 04:43 AM | #8 | |
| null operator (he/him)            Posts: 22,010 Karma: 30277294 Join Date: Mar 2012 Location: Sydney Australia Device: none | Quote: 
 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. | |
|   |   | 
|  03-03-2019, 07:55 AM | #9 | ||
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | Quote: 
 Mind that the --separator is ignored when --for-machine is used. Quote: 
 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... | ||
|   |   | 
|  03-03-2019, 08:20 AM | #10 | 
| creator of calibre            Posts: 45,604 Karma: 28548974 Join Date: Oct 2006 Location: Mumbai, India Device: Various | 
			
			calibredb catalog test.csv --fields=title,authors For more information: calibredb catalog test.csv --help | 
|   |   | 
|  03-03-2019, 09:52 AM | #11 | |
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | Quote: 
 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 | |
|   |   | 
|  03-05-2019, 10:24 AM | #12 | 
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | 
				
				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 ? | 
|   |   | 
|  03-05-2019, 03:58 PM | #13 | 
| null operator (he/him)            Posts: 22,010 Karma: 30277294 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. | 
|   |   | 
|  03-05-2019, 04:43 PM | #14 | 
| Groupie            Posts: 168 Karma: 31650 Join Date: May 2011 Location: Asuncion (Paraguay) Device: In the house, 3 K3 in use, 4 more in storage, and a K5 for testing | |
|   |   | 
|  | 
| Thread Tools | Search this Thread | 
| 
 | 
|  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 |