View Single Post
Old 02-04-2025, 06:24 AM   #25
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,786
Karma: 30237628
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
It seems that this plugin will be used so I added the appropriate first post to add it to the plugin index.

As for how many backups to keep, this is made a bit complicated by the fact that other files can exist in the backup folder. I can't scan for a certain time and delete if older. I can work around this by keeping a list of backups, but this suffers from itself being a config preference. If a config is restored the preference will be as well, probably orphaning some files. The user will be required to look and clean from time to time.

I will add two configuration lines:
  • Days to keep all backups: [N] (default 3)
  • Days to keel last backup: [N] (default 10)
Reasoning: if something goes wrong then having access to all the latest config backups for a few days could be a life saver because you don't know when things broke. For older backups, the last will be sufficient.

And yes, to restore a backup, close calibre then extract the zip file into the configuration folder. To be the most safe, rename the config folder, create a new one, then extract the zip. This ensures that no "extra" config files are left over. This "restore" can't safely be done inside calibre.
Suggestions

1. A button in the plugin's Config dialogue to open the backup folder - companion to the button to open the config folder in Prefs-Miscellaneous.

2. Put some instructions in the opening post of this thread on how to restore a configuration from a previous backup.

Surprisingly little code was needed.

BR
BetterRed is offline   Reply With Quote