Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Automatic Save after Add or Update

2013-10-30
2014-03-11
  • RH Hutchins
    RH Hutchins
    2013-10-30

    I use a thumb drive to store my KeePass data. Sometimes I forget that I have changed the database and close KeePass without saving. I've also had power outages catch me with unsaved data.

    I looked through the Help and other screens for some way to automatically do a database save after every add, change or delete action. If there is such an option, I couldn't find it under Tools > Options or in any of my searching. If such an option exists, could someone please tell me how to find it. If it doesn't exist, how do I go about making a change request?

    TIA

     
  • wellread1
    wellread1
    2013-10-30

    You can implement an Auto-Save using triggers. It is also useful to be able to turn the Auto-Save feature ON and OFF using a custom toggle button. I have provided a set of five triggers that accomplish this. The triggers are generalized for the active database so they should not need modification. If you already use custom buttons, the "On KeePass start: Load Auto Save button, initialize" should be the last button loaded. You should be able to copy and paste the triggers below directly into your trigger system. To paste into the Triggers dialog: press the Tools button (lower left corner)

    OOPs the posted trigger contains an error. Will repost shortly

     
    Last edit: wellread1 2013-10-30
  • wellread1
    wellread1
    2013-10-30

    Corrected Trigger set.

    <?xml version="1.0" encoding="utf-8"?>
    <TriggerCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Triggers>
            <Trigger>
                <Guid>gBH/MZ7ynUCRjBBVAZxEbw==</Guid>
                <Name>On KeePass start:  Auto Save buttons, initialize</Name>
                <Events>
                    <Event>
                        <TypeGuid>1M7NtUuYT/KmqeJVJh7I6A==</TypeGuid>
                        <Parameters />
                    </Event>
                </Events>
                <Conditions />
                <Actions>
                    <Action>
                        <TypeGuid>lYGPRZlmSYirPoboGpZoNg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                            <Parameter>Turn Auto Save OFF</Parameter>
                            <Parameter />
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter>On db changed:  Save</Parameter>
                            <Parameter>1</Parameter>
                        </Parameters>
                    </Action>
                </Actions>
            </Trigger>
            <Trigger>
                <Guid>mfzSS4gfeUyi1ERz1Vh7uQ==</Guid>
                <Name>On db opened: Turn Auto Save On</Name>
                <Events>
                    <Event>
                        <TypeGuid>5f8TBoW4QYm5BvaeKztApw==</TypeGuid>
                        <Parameters>
                            <Parameter>0</Parameter>
                            <Parameter />
                        </Parameters>
                    </Event>
                </Events>
                <Conditions />
                <Actions>
                    <Action>
                        <TypeGuid>1m1BomyyRLqkSApB+glIeQ==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>1m1BomyyRLqkSApB+glIeQ==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_ON</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>lYGPRZlmSYirPoboGpZoNg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                            <Parameter>Turn Auto Save OFF</Parameter>
                            <Parameter />
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter>On db changed:  Save</Parameter>
                            <Parameter>1</Parameter>
                        </Parameters>
                    </Action>
                </Actions>
            </Trigger>
            <Trigger>
                <Guid>dzatldc/jkOKLpkWmxGtCg==</Guid>
                <Name>On db changed:  Save</Name>
                <Events>
                    <Event>
                        <TypeGuid>jRLUmvLLT/eo78/arGJomQ==</TypeGuid>
                        <Parameters />
                    </Event>
                </Events>
                <Conditions>
                    <Condition>
                        <TypeGuid>08r67ygqRkqZkNhl/OAW7Q==</TypeGuid>
                        <Parameters />
                        <Negate>false</Negate>
                    </Condition>
                </Conditions>
                <Actions>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter />
                            <Parameter>0</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>9VdhS/hMQV2pE3o5zRDwvQ==</TypeGuid>
                        <Parameters />
                    </Action>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter />
                            <Parameter>1</Parameter>
                        </Parameters>
                    </Action>
                </Actions>
            </Trigger>
            <Trigger>
                <Guid>dy/Jd4wZA02w5yj/l2U//A==</Guid>
                <Name>Turn Auto Save OFF Action</Name>
                <Events>
                    <Event>
                        <TypeGuid>R0dZkpenQ6K5aB8fwvebkg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                        </Parameters>
                    </Event>
                </Events>
                <Conditions />
                <Actions>
                    <Action>
                        <TypeGuid>1m1BomyyRLqkSApB+glIeQ==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter>On db changed:  Save</Parameter>
                            <Parameter>0</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>lYGPRZlmSYirPoboGpZoNg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_ON</Parameter>
                            <Parameter>Turn Auto Save ON</Parameter>
                            <Parameter />
                        </Parameters>
                    </Action>
                </Actions>
            </Trigger>
            <Trigger>
                <Guid>igyBmu926U6efCRtjBlJBQ==</Guid>
                <Name>Turn Auto Save ON Action</Name>
                <Events>
                    <Event>
                        <TypeGuid>R0dZkpenQ6K5aB8fwvebkg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_ON</Parameter>
                        </Parameters>
                    </Event>
                </Events>
                <Conditions />
                <Actions>
                    <Action>
                        <TypeGuid>9VdhS/hMQV2pE3o5zRDwvQ==</TypeGuid>
                        <Parameters />
                    </Action>
                    <Action>
                        <TypeGuid>1m1BomyyRLqkSApB+glIeQ==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_ON</Parameter>
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>lYGPRZlmSYirPoboGpZoNg==</TypeGuid>
                        <Parameters>
                            <Parameter>btn_Turn_Auto_Save_OFF</Parameter>
                            <Parameter>Turn Auto Save OFF</Parameter>
                            <Parameter />
                        </Parameters>
                    </Action>
                    <Action>
                        <TypeGuid>tkamn96US7mbrjykfswQ6g==</TypeGuid>
                        <Parameters>
                            <Parameter>On db changed:  Save</Parameter>
                            <Parameter>1</Parameter>
                        </Parameters>
                    </Action>
                </Actions>
            </Trigger>
        </Triggers>
    </TriggerCollection>
    
     
  • Paul
    Paul
    2013-10-31

    You can also set KeePass to automatically save on close / lock.
    Tools > Options > Advanced.

    cheers, Paul

     
  • RH Hutchins
    RH Hutchins
    2013-11-04

    Thank you, Paul!

    I've set the option in Tools > Options > Advanced for now and will work on the triggers later.

    Thank you again.

     
  • Paul
    Paul
    2014-03-11

    wellread1, your trigger is now in the trigger examples, although I did remove the database save when you click the button to turn the save on.

    cheers, Paul

     
  • wellread1
    wellread1
    2014-03-11

    Thanks Paul! I am pleased if others find the triggers useful.

    It might be helpful to include some installation instructions along the lines:

    To install: Select and copy the trigger text to your clipboard. Then press the Tools button in the Trigger dialog and select "Paste Triggers from Clipboard".

     
  • Paul
    Paul
    2014-03-11

    That bit is at the top of the examples.

    cheers, Paul