I tried to do a smaller batch even before reading your suggestions. With a batch of 40, it caused the same shutdown, and I thought it was caused by one of the books. Doing batches of 5, I managed to get through the 40 books without problems. I think from now on I'll stick to 15-20 books per batch.
thanks for the suggestions.
I'm mainly using Calibre as an offline repository for fanfic and I'm using FFDL to download books as epubs. I have two pdf only books (and have already used count pages on them), all the others (some 2300 books) have epub formats. I use epub as the default format.