Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2017, 01:50 PM   #1
lynncal
Junior Member
lynncal began at the beginning.
 
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
lynncal is offline   Reply With Quote
Old 06-12-2017, 02:24 PM   #2
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
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.
itimpi is offline   Reply With Quote
Old 06-12-2017, 02:24 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just right click the remove books button and choose remove files of a specific format
kovidgoyal is offline   Reply With Quote
Old 06-12-2017, 02:25 PM   #4
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 296
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.
fidvo is offline   Reply With Quote
Old 06-12-2017, 02:33 PM   #5
lynncal
Junior Member
lynncal began at the beginning.
 
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!
lynncal is offline   Reply With Quote
Old 03-17-2024, 08:24 PM   #6
Th0m5k
Junior Member
Th0m5k began at the beginning.
 
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?
Th0m5k is offline   Reply With Quote
Old 03-17-2024, 08:53 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Th0m5k View Post
Thanks for this thread.

What if you want to mass remove mobis but only if there is already an epub version?
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.
DNSB is offline   Reply With Quote
Reply

Tags
file formats, mass update, sql


Forum Jump

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


All times are GMT -4. The time now is 04:55 PM.


MobileRead.com is a privately owned, operated and funded community.