Calibre, Part Three

Calibre, Part Three
Photo by Susan Q Yin / Unsplash

Install Calibre Server

Step 6 - (Optional) Automatically Adding Books to Your Calibre Library

Steps performed on CALIBRE-01

  • mkdir /home/david/books-to-add
  • cd books-to-add
  • wget https://www.gutenberg.org/ebooks/11.epub.images -o alice.epub
  • crontab -e
    • */5 * * * * calibredb add /home/sammy/books-to-add/ -r --with-library http://localhost:8080#calibre-library --username mycalibreuser --password StrongPassword! && rm -r /home/sammy/books-to-add/*

I have always had trouble with crontab -e. I saved the file at 9:55am so I should find out by 10:00am if it works or not.

I come back to this at 10:01am so let's see....I do not have the new book. Well I failed to update that script for my user instead of the walkthrough's user. I make that quick update and saved at 10:04am.

I come back to check on this again at 10:14am and there is still no book. Ok, let's try this a different way.

  • sudo nano /etc/crontab
    • calibredb add /home/david/books-to-add/ --with-library /home/david/calibre-library/ && rm -r /home/david/books-to-add/*

I am pretty sure this will work. I've cleaned out all of the test books from the library and I'll push a few of the books I downloaded on to the server to test the cronjob with.

So I set up three test books into the books-to-add directory and then turned on the cron task at 10:35am. I think it's time for a break so I'll check on it later. Well....it's already moved the books before I could get up from my desk. I put a fourth book into the directory and then walk away to take my break.

I came back after my break and the fourth book has moved successfully as well. I create a copy of all my books in the books-to-add directory. It's working like a charm!