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 09-24-2016, 01:58 AM   #1
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
Convert and copy new books to library, headless linux calibre

I'm looking for some help with a linux bash script (I think is a good solution). I'm horrible at writing this stuff, and could use help, if anyone is inclined.

I've got a folder of various types of books, mobi, epub. From time to time, I'll dump another book into this folder. I'd like to set a cron.hourly to run a bash script that:

If there’s a book in toadd-folder (
1. If it's a .mobi file
a. break
Else
a. convert to mobi
b. delete non mobi files
2. Import book to Calibre
3. Move original to alternate storage folder
)


Looks like this

Code:
xvfb-run calibredb add
interesting setup from digitalocean
mrdrew is offline   Reply With Quote
Old 09-24-2016, 02:22 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: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
While I am not going to write the script for you, I'll just note that there are a couple of bits of obsolete advice in that digital ocean writeup. You dont need xvfb-run any more and you dont need to install imagemagick.
kovidgoyal is offline   Reply With Quote
Advert
Old 09-30-2016, 11:19 AM   #3
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
Quote:
Originally Posted by kovidgoyal View Post
While I am not going to write the script for you, I'll just note that there are a couple of bits of obsolete advice in that digital ocean writeup. You dont need xvfb-run any more and you dont need to install imagemagick.
Thank you very much! The internet is a little slow at updating their stuff for sure - ubuntu 16.04. I've posted a comment over there with a link to this thread.

have a great day
mrdrew is offline   Reply With Quote
Old 09-30-2016, 12:33 PM   #4
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,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by mrdrew View Post
Thank you very much! The internet is a little slow at updating their stuff for sure - ubuntu 16.04. I've posted a comment over there with a link to this thread.

have a great day
Mr drew

The issue with the Internet, is not everyone wants to/can run the Latest versions of software. (IT controls any system updates, Limited $...)

Documentation needs to reflect applicable OS, release level when there is a update that obsoletes or modifies sections

eg.
(V 1.48) last supported version on XP
(V x.yy) last version that runs on processors without SSE2
theducks is offline   Reply With Quote
Old 03-10-2017, 01:57 AM   #5
mrdrew
Junior Member
mrdrew began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2016
Device: kindle paperwhite
got a bash script sorted out to simplify this

Quote:
#!/bin/bash
for f in *.epub; do
# do some stuff here with "$f"
filename=$(basename "$f")
extension="${filename##*.}"
filename="${filename%.*}"

echo "working on $f..."
ebook-convert "$f" "$filename.mobi"
# remember to quote it or spaces may misbehave
done
mrdrew is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Calibre on Headless Linux dchagnon Devices 3 12-17-2013 04:18 PM
Copy library and books javirulo007 Library Management 5 05-21-2013 02:31 AM
Suggestion:not copy books to library sinojelly Library Management 2 06-10-2011 07:44 PM
copy from one Calibre library to another Purple Lady Calibre 4 12-12-2010 01:40 AM
Installing calibre solely for ebook-convert on headless system Zeroth Related Tools 1 08-24-2010 08:59 PM


All times are GMT -4. The time now is 12:06 PM.


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