marvinweber / KPSimpleBackup

KPSimpleBackup - Backup Plugin for KeePass2 (compatible with IOProtocolExt)
GNU General Public License v3.0
129 stars 8 forks source link

Does the plugin handle databases created by triggers as well? #31

Closed ams-tschoening closed 3 years ago

ams-tschoening commented 3 years ago

I have one company wide database placed on a SAMBA-share. Sometimes that share is not available, e.g. when the corresponding host gets restarted for maintenance or alike, but even then I need passwords from that database to maintain other hosts etc. So I created a trigger which creates a local copy whenever the shared database gets saved. That trigger already is restricted to really fire ONLY for the shared database identified by it's UNC-path.

What I would like to achieve is using KPSimpleBackup once relative paths to the database are supported and whenever the database on the share gets saved, create automatic backups on the share as well AND still fire my trigger to create a local copy of the shared database. Because that local copy is saved again, it would be great to have the plugin come into play again and store backups for the local copy as well.

In theory, this way I would get X backups on the share and the same X backups locally automatically. Is something like that possible or would the trigger make the plugin NOT fire at all for some reason? Thanks!

marvinweber commented 3 years ago

I assume you use the "Export active database" trigger?

If so, no, the exported database will not be backed-up additionally. As far as I see, this would not make sense, though. If I save my database, lets say db.kdbx, backups for this db.kdbx are created properly.
Now your trigger exports the database again to, e.g., db-from-trigger.kdbx. What would be the benefit of backing up this file again as the backup of db.kdbx is already created and db.kdbx === db-from-trigger.kdbx?

However, you can add two backup locations for the database: one relative to the database file itself (which then will be stored on your network share) and one absolute backup path for local backups. That would also create X backups on your share and the same X backups on your local computer.

ams-tschoening commented 3 years ago

Thanks, two backup locations and not using my trigger anymore really seem to be the easier approach then. Looking forward for version 1.4.

ams-tschoening commented 2 years ago

For my own docs: Two backup locations in the plugin don't seem to work in my use-case...

I have a customer with which I'm sharing one and the same database and which is stored on his NAS. I'm using your plugin to create backups on his NAS whenever I store the database. I'm still using my trigger, though, to additionally export that database to my own local storage and SAMBA share. Storing my own copies on my local storage and SAMBA is done by using the exporting action and in those cases your plugin doesn't trigger as said already.

But here's the point: As I don't have access to the master database all the time, it would simply be nice to have a local backup history. Of course, I'm backing up the local storage, SAMBA etc. as well, but your plugin might make it a bit easier to access old files.

Though, your suggestion to create an additional backup folder in your plugin doesn't work for me, because I'm not only working with this one database. I have lots of them for private use, for other customers etc. But your folder config is global to KeePass and not specific to some open file, at least that's how I understand things. So with an additional path in your plugin pointing somewhere at my local storage or SAMBA, all of my databases would be copied there as well whenever saved.

Looks like I would still need some additional way of triggering your plugin for the exported database. But that is not open, of course I wouldn't want to additionally input credentials for that database as those are stored in another one etc. Need to think about this... :-)