06-12-2017, 01:50 PM | #1 |
Junior Member
Posts: 4
Karma: 10
Join Date: Apr 2013
Device: iPad
|
Mass delete of .mobi files
So, I wanted to get rid of all of my mobi ebook formats as I have the epubs. The mobi format books were taking up over 15GB of space. I decided to run a command in the cmd window (I'm running Windows 7) in the Calibre files home directory:
cd c:\calibre library forfiles /S /M *mobi /C "cmd /c move @files F:\mobi My files were moved from the calibre library folders, but the links in the GUI interface are still there. I'm in SQLite and found the table with the formats, but am hesitant to build and run any script that might corrupt the database in my attempts to remove this link. I'm working off of a copy of the database, so I don't do anything by mistake that would wreck things. Does anyone have a SQL script that removes format links where there is no format file there? Thanks. Lynn |
06-12-2017, 02:24 PM | #2 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
You should have used the option from within Calibre to delete books of a specific format! That would have kept the library files in step with the Calibre database. Working at the command line level will always leave your library in an inconsistent state and should be avoided.
You best option now is to run the Calibre Library maintenance option and tell it to fix any errors when it flags up lots of missing book files. |
06-12-2017, 02:24 PM | #3 |
creator of calibre
Posts: 44,001
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Just right click the remove books button and choose remove files of a specific format
|
06-12-2017, 02:25 PM | #4 |
Addict
Posts: 298
Karma: 1599870
Join Date: Jun 2012
Device: none
|
You've already broken the Number 1 rule of using Calibre. Don't mess with the files in the library folder. Let me repeat that. Don't mess with the files in the library folder.
Normally this would result in a lot of headaches and pain and a bit of swearing as you try to fix what you broke, but in this case you're in luck. You can still delete these books from the Calibre database, using the method you should have used in the first place. Start the Calibre program. Filter your books for deletion (use "Formats" in the Tab browser to show only .mobi books). Select all the filtered books, then right-click on one of them and choose Remove -> Remove files of a specific format from books. Choose Mobi and press OK. This will remove the mobi formats from the books while preserving the epub formats. Normally this will also delete the mobi files from the library folder, but you already did that yourself. And yes, I tested it to make sure it won't get an error. |
06-12-2017, 02:33 PM | #5 |
Junior Member
Posts: 4
Karma: 10
Join Date: Apr 2013
Device: iPad
|
Thanks everyone. I guess I have to learn my lessons the hard way, but lesson learned!
|
03-17-2024, 08:24 PM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2024
Device: Kindle Paperwhite
|
Thanks for this thread.
What if you want to mass remove mobis but only if there is already an epub version? |
03-17-2024, 08:53 PM | #7 |
Bibliophagist
Posts: 36,605
Karma: 146496996
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
In the left column under Formats, select epub or enter 'formats:"=EPUB"' in the search box. In the book browser, select all. Right click, Remove books => Remove files of a specific format from selected books, select Mobi and OK.
|
Tags |
file formats, mass update, sql |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mass delete of unpopular tags | jacr | Library Management | 25 | 07-21-2018 10:43 PM |
Mass rename files | r2d256 | Calibre | 6 | 11-21-2015 10:18 PM |
A way to mass delete Ids? | raithe | Library Management | 9 | 10-22-2015 06:36 AM |
How To mass-convert ereader files into HTML and then into MOBI | GatorDeb | Kindle Formats | 2 | 12-18-2009 03:51 PM |
Delete files in PC not equal to delete in Sony reader 505 | sheilalayoli | Sony Reader | 5 | 07-12-2009 03:13 PM |