Quote:
Originally Posted by qwertyuio
After messing up a bulk edit I am wondering if it is possible to get calibre to create a backup copy of metadata.db each time it is shutdown. That is, on exit, copy metadata.db to metadata-backup-yymmdd.db (or some other numbering system) up to a maximum number of backups.
This would allow me to restore a previous metadata.db and run check_library to revert to a previous state. I do keep regular backups of my filesystem but these are only run once a day. When I spend an afternoon cleaning up metadata I usually start and stop calibre several times so there would be the potential to save a lot of work reverting to a known good state.
I thought of wrapping calibre in a script to do this but I have several libraries so it is a bit more complicated than a 3 line script.
|
On the basis that Prevention is better than Cure, when I'm unsure of something that I'm about to do in metadata edit search & replace, I copy some relevant books to an
empty library using calibre's Copy to library tool, and then test my S&F-fu there. If I stuff up I start over.
I would advise against doing 'cherry pick' backups of calibre libraries or anything similar - e.g your browser's configuration settings. Any time 'saved' doing the backup will be lost many times over when you have to do a restore, the raison d'être of backups. Not only might it be an intricate process, it won't be a familiar process, and you're likely to be in stressed state.
Aside: The check_library tool compares the folder and file names of a library against the database and reports any 'structural' anomalies - e.g. author folders with no matching row in the database authors table, missing/extra formats etc. Some anomalies can be rectified with a button click, whilst others must be done via the file manager. But they all bare 'thinking about' before doing anything.
And if you overwrite library's metadata.db file you may need to (should ??) regenerate the metadata.opf files in the book folders (they are needed by the restore_database tool). This can be done using the calibredb backup_metadata sub command, be aware it can take a while.
BR