Menu

trigger looping though "on to off trigger state change" action enabled

Help
2017-09-23
2017-09-23
  • Pharaonic Faery

    Pharaonic Faery - 2017-09-23

    Hi ! I erased my first post because I was ashamed. It was about a trigger where my database syncs with DropBox when starting KeePass. I thought it looped endlessly. Actually, it loops only 4 times. Or maybe I just believe it does. I just saw it beginning to loop, then I rushed on this forum... And i felt stupid.
    I don't remember exactly, but by reading the following post, I guess I copied a trigger from a Windows computer to an Ubuntu one...

     

    Last edit: Pharaonic Faery 2017-10-21
  • T. Bug Reporter

    T. Bug Reporter - 2017-09-24

    The only thing I can think of is that the differences in how file paths are specified between Windows and Ubuntu are messing with the works. You may have to set up separate triggers for the different OSs, and test an environment variable to determine which to use.

    (For the benefit of anyone else who wants to work on this, I've added formatting and a few comments to your trigger and reposted it below.)


    <TriggerCollection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <Triggers>
      <Trigger>
       <Guid>WpeSRv0Ze0O+dP77eeQXwQ==</Guid>
       <Name>get database latest synced modifications from DropBox app</Name>
       <TurnOffAfterAction>true</TurnOffAfterAction>
       <Events>
        <Event>
         <TypeGuid>5f8TBoW4QYm5BvaeKztApw==<!-- Opened database file --></TypeGuid>
         <Parameters>
          <Parameter>0</Parameter>
          <Parameter>/media/user/data/database.kdbx</Parameter>
         </Parameters>
        </Event>
       </Events>
       <Conditions/>
       <Actions>
        <Action>
         <TypeGuid>tkamn96US7mbrjykfswQ6g==<!-- Change trigger on/off state --></TypeGuid>
         <Parameters>
          <Parameter/>
          <Parameter>0</Parameter>
         </Parameters>
        </Action>
        <Action>
         <TypeGuid>Iq135Bd4Tu2ZtFcdArOtTQ==<!-- Synchronize active database --></TypeGuid>
         <Parameters>
          <Parameter>/home/morgan/Dropbox/database.kdbx</Parameter>
          <Parameter/>
          <Parameter/>
         </Parameters>
        </Action>
        <Action>
         <TypeGuid>tkamn96US7mbrjykfswQ6g==<!-- Change trigger on/off state --></TypeGuid>
         <Parameters>
          <Parameter/>
          <Parameter>1</Parameter>
         </Parameters>
        </Action>
       </Actions>
      </Trigger>
     </Triggers>
    </TriggerCollection>
    
     
  • T. Bug Reporter

    T. Bug Reporter - 2017-09-24

    Does the disappearance of the text of your original post mean that you fixed your problem on your own? (It would be nice to know how you resolved it - and nice to let others see what the problem originally was. Lately, this forum has had a rash of users erasing their postings like this, and I for one find it rather rude. Better to let others read about and avoid your mistakes, even if they do make you look stupid; better to admit to an occasional brain fart than to appear unwilling to contribute.)

     
  • Pharaonic Faery

    Pharaonic Faery - 2017-10-21

    I'm so sorry. I guess I did it when you were answering... There was still no response...
    Actually, there was no problem. The sync triggered when starting KeePass seems to loop 4 times then it's OK.

     
  • Paul

    Paul - 2017-10-22

    The trigger shouldn't loop because you turn the trigger off before the sync.
    Can you add an action immediately before the sync that appends data to a file, then check if you have 1 append or more?

    cheers, Paul

     

Log in to post a comment.

MongoDB Logo MongoDB