Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 02-03-2025, 12:30 PM   #16
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by PeterT View Post
|Seems to work fine on my calibre install on a Chromebook. Would be nice to have an easy means to select backup location in the configuration dialog; had to type in the path I wanted (I know... 3rd world problem)
This version (1.0.1) has a button to select the folder. It also cleans up the tooltips.

EDIT: See the first post for the newest version of the plugin.

Last edited by chaley; 02-04-2025 at 05:33 PM.
chaley is offline   Reply With Quote
Old 02-03-2025, 01:01 PM   #17
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,144
Karma: 78857258
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Looks good to me
PeterT is offline   Reply With Quote
Advert
Old 02-03-2025, 02:33 PM   #18
dunhill
Guru
dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.dunhill ought to be getting tired of karma fortunes by now.
 
dunhill's Avatar
 
Posts: 825
Karma: 409968
Join Date: Sep 2017
Location: Argentina
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by chaley View Post
Here is a LibraryClosedPlugin that backs up the configuration folder to a zip file when calibre is closed. It ignores library change events and configuration change restarts. It is configured using Preferences / Plugins / Library closed / Backup Configuration Folder then Customize Plugin. The defaults are probably sufficient for most people.

I've tested it on my config that uses CALIBRE_CONFIG_DIRECTORY. I haven't tried it without the ENV variable because everything I run uses it.

Thanks to @dunhill for the shutil.make_archive() pointer. Using it simplified things a lot.

I'll add this to the plugin index if there is sufficient interest.
Thank you very much for enlightening us on this topic as on so many others. And thanks for giving the script idea a plugin form.
dunhill is offline   Reply With Quote
Old 02-03-2025, 03:29 PM   #19
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 441
Karma: 3367292
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
Just gave it a try on my Linux installation...works fine!
retiredbiker is offline   Reply With Quote
Old 02-03-2025, 05:34 PM   #20
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
FWIW: on Windows the program WinMerge shows you the difference between files in the .zips without unpacking them first. It does the unpack internally. It also shows differences between the "real" config folder and one of the zips. It works very well on my Win11 machine.
chaley is offline   Reply With Quote
Advert
Old 02-03-2025, 05:45 PM   #21
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,546
Karma: 7463599
Join Date: Sep 2020
Device: none
I found that it's possible to leave the second field blank, so I'm grouping them in my original backup folder:

Click image for larger version

Name:	2025-02-03 19_33_35-Customize Backup Configuration Folder.png
Views:	61
Size:	10.8 KB
ID:	213405

At the moment I'm thinking this will create more backups than I need, as I do quite frequent Calibre restarts. Perhaps a GUI button to run it on demand would be the best solution for my case but I'm aware of the risks of creating a config backup while Calibre is running.

(yet I've never had issues after restoring backups made with the script I run, which most times I do with Calibre running )
Comfy.n is offline   Reply With Quote
Old 02-03-2025, 05:58 PM   #22
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,506
Karma: 29709834
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Works fine on latest Windows Portable preview, and on my installed 7.24.

My request wasn't intended for my use, the folder is in my end-of-day backup. It was to have something I could suggest others might want to use. But I'm going to keep it, there have been occasions where I've done an ad-hoc backup of my config, now all I have to do is restart calibre.

But, there's always a but… In fact there's two:

1. should the number of backups stored be limited in some way? My preference would be N days.

2. How would the user restore a backed up configuration?

BR
BetterRed is offline   Reply With Quote
Old 02-03-2025, 06:22 PM   #23
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: 43,536
Karma: 165170836
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I would vote for a limit on the number of backups, i.e. keep last N backups.

Extract it back to the configuration folder without calibre running?
DNSB is offline   Reply With Quote
Old 02-04-2025, 05:45 AM   #24
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
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 keep 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 of the day 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.

Quote:
Originally Posted by Comfy.n View Post
(yet I've never had issues after restoring backups made with the script I run, which most times I do with Calibre running )
Calibre will save config information using in-memory values. Changes made to config files will be lost in this case.

Last edited by chaley; 02-04-2025 at 05:36 PM.
chaley is offline   Reply With Quote
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,506
Karma: 29709834
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
Old 02-04-2025, 06:46 AM   #26
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
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.
OK, but note that it will open the folder specified by the options above the button, not a folder previously used.
Quote:
2. Put some instructions in the opening post of this thread on how to restore a configuration from a previous backup.
I'll get to that eventually. It will be of necessity vague, for example "Use your favorite ZIP manager to ...". What manager controls what steps. For example, 7-zip has shell extensions that can extract to a specified folder. Others, for example the built-in windows one, might require you copy the ZIP into the folder then extract all.
Quote:
Surprisingly little code was needed.
As usual 99% of the work is in the UI.
chaley is offline   Reply With Quote
Old 02-04-2025, 12:20 PM   #27
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
New version available:
  • Implements auto-cleaning of the backup zip files. See the first post for notes. Really look, because if you are running a previous version then you must do some cleanup yourself.
  • Now shows the values of the folder/file templates in the configuration dialog.
  • Many tooltip changes.
  • Added to the Index of Plugins in the "Library Closed Plugin" section.
The plugin's zip is in the first post.
chaley is offline   Reply With Quote
Old 02-04-2025, 05:56 PM   #28
Comfy.n
want to learn what I want
Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.Comfy.n ought to be getting tired of karma fortunes by now.
 
Posts: 1,546
Karma: 7463599
Join Date: Sep 2020
Device: none
Quote:
Originally Posted by chaley View Post
Calibre will save config information using in-memory values. Changes made to config files will be lost in this case.
Thanks for the confirmation, hope I understood correctly. What I often do is running the script when I sense I might be doing something I would want reverted if it goes south. JS+ configuration changes for instance. So what I intend is exactly that: the current config before the changes.
Comfy.n is offline   Reply With Quote
Old 02-04-2025, 06:44 PM   #29
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,506
Karma: 29709834
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by chaley View Post
New version available:
  • Implements auto-cleaning of the backup zip files. See the first post for notes. Really look, because if you are running a previous version then you must do some cleanup yourself.
  • Now shows the values of the folder/file templates in the configuration dialog.
  • Many tooltip changes.
  • Added to the Index of Plugins in the "Library Closed Plugin" section.
The plugin's zip is in the first post.
I removed the plugin and the backups already taken and started over with the default configuration, which I'm going to go with until I find a reason to change anything.

FTR: it's everything and more than what I had in mind when I suggested it.

to chaley.

BR
BetterRed is offline   Reply With Quote
Old 02-05-2025, 07:46 AM   #30
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,270
Karma: 7955525
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
New release 1.0.4:
  • Stop throwing exceptions and failing when deleting a backup file that is supposed to be there but isn't.
  • Add another line to the configuration dialog showing the full path to the backup folder.
  • Internal restructuring to make my IDE, and therefore me, happier. This shouldn't have changed any behavior.
chaley is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
backup function for the configuration folder? Martin Calibre 18 08-18-2023 04:03 AM
Is there a way to backup my settings/configuration? birkmaggs Calibre 8 04-21-2023 10:26 PM
Configuration backup kshane9 Library Management 2 11-17-2017 02:11 PM
Change location of configuration folder macnab69 Library Management 10 11-04-2015 09:22 AM
Local backup folder is located where? pewterbot9 enTourage Archive 1 12-30-2010 02:16 PM


All times are GMT -4. The time now is 11:17 AM.


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