It seems that Calibre has functionality in the command line:
I'm not clear on whether or not that's something you've done before. If so, great! If not, try it with one to get a feel for how it works.
Once you know it's working OK, then I think you can probably build a little script to do it batchwise. The gist will be to write a loop to iterate over all of the .epub files in your collection and feed them to the ebook_covert command with an output name and location. You might also have a look through all of the commandline options available, as you might find some of them handy
Without having an ebooks, it's a bit hard to test. But, I would imagine this is a good start of sorts:
Replace all of the stuff that I put in <> with specific information, and take care to be sure you've got the order of things correct by verifying you've called the ebook-covert command with the correct options and whatnot. You can build up from there, creating variables for the output directories, using some shell replacement techniques for renaming the books, etc.
for book in "<location>/*.epub"; do ebook-covert "$book" "<output_location>/<output_name>" [options]; done
The one big thing to remember is to surround your variables with quotation marks so that the shell will be able to handle any books with spaces or special characters in their names.