Code:
calibredb add [--one-book-per-directory --with-library=LIBRARY_PATH] folder1 [folder2 folder3 ...]
will add a book to a library (defaults to currently selected startup library), using one-book-per-directory you can choose the library book subfolder.
Code:
calibredb list [--with-library=LIBRARY_PATH] [-s SEARCH]
can pass you info about the books in a library, with appropriate scripting you can extract the /path/to/book.
Code:
calibredb remove [--with-library=LIBRARY_PATH] comma-separated-list-of-book-ids
can then delete the book from the original library.