tag:infinitekind.tenderapp.com,2009-01-14:/discussions/moneydance-development/2056-extension-to-watch-for-or-modify-backup-file-nameInfinite Kind: Discussion 2019-01-29T07:57:15Ztag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-15T18:10:41Z2018-02-17T15:07:37ZExtension To Watch-For or Modify Backup File Name<div><p>Hmm. One more thing... At an initial glance, I thought the config.dict fie was in JSON format. But when submitting it to several online JSON verify sites, they are all reporting it is invalid. So what format is this? Thanks</p></div>whitedavidptag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-15T20:53:30Z2018-02-17T15:07:38ZExtension To Watch-For or Modify Backup File Name<div><p>Maybe the answer to my own question - is the config.dict a StreamTable? And can it be found via LocalStorage? Seems possible. If so, the backup location is retrieved as a String with the key: "backup.location"? Thanks!</p></div>whitedavidptag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-15T21:22:26Z2018-02-15T21:22:26ZExtension To Watch-For or Modify Backup File Name<div><p>Your extension would have to be constantly running and somehow able to execute after the backup has finish and before Moneydance exits, I doubt if that is possible.</p>
<p>I suspect you would have a better chance in scripting a solution.</p>
<p>Basically running Moneydance via a script file rather than calling the executable directly. When you exit Moneydance the script can take over, if you use Moneydance's own backups then copying to another location and renaming them, I would not leave them in the same location as moneydance is set to keep "X" number of backups and with trying to keep multiple daily backups you would be more likely to want to keep "Y" days worth of backups, or you could just dispense with Moneydance's backups and create your own using your favourite zip file program from the command line.</p>
<p>Naturally your script should also do the housekeeping necessary to purge old backups.</p></div>dwgtag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-15T21:53:23Z2018-02-17T15:07:38ZExtension To Watch-For or Modify Backup File Name<div><p>My issue seems to come if I open/close MD more than once per day. I am doing that alot right now. Otherwise, I am fine with the backup file being named as is now. So<br>
I was actually thinking my extension should run when MD starts. Since MD performs the backup upon exit, the extension should find any previous moneydancearchive file with the current date and be able to rename it in-place. Then when MD exits again there will be a new file created which does NOT over write the previous one. I have no idea how to get the extension to run upon startup. But I can see that somehow the Quotes extension is getting triggered after startup (or so it appears). Thanks!</p>
<p>PS - but your idea to run it all via a script is far simpler than what I have cobbled together so far. Not thinking very clearly, I guess.</p></div>whitedavidptag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-15T22:43:19Z2018-02-15T22:43:19ZExtension To Watch-For or Modify Backup File Name<div><p>I believe the Q & ER extension is open sourced (another user did make a modification to it in recent times) so I think you should be able to grab a copy of it and see how they get it to run on startup, the time stamp you apply however will not represent the creation time of the file, I suppose you could see if you can interrogate the file properties to get the creation date and use that.</p>
<p>Renaming the file in place could be a problem, I do not know how the keep "X" files algorithm works in Moneydance so renaming files could well break this and result in you having to do some file maintenance.</p></div>dwgtag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-16T01:00:06Z2018-02-17T15:07:38ZExtension To Watch-For or Modify Backup File Name<div><p>Why yes, you are exactly right. I should query the file's time stamp and use that, not the current time. Not sure what I was thinking but it wasn't too clearly. I agree that the file maintenance may become an issue. Right now I have mine set to infinite with the intention of managing it myself. But that could change.</p>
<p>Right now still having some problems getting some of the API functions to work as anticipated when listing files/folders in the user's home directory. I am starting off slowly and fooling around in Python rather than going whole-hog into Java. That may prove the best way to go eventually. But the learning is somewhat faster without the need to compile, etc.</p>
<p>Cheers!</p></div>whitedavidptag:infinitekind.tenderapp.com,2009-01-14:Comment/447362832018-02-19T03:01:26Z2018-02-19T03:01:27ZExtension To Watch-For or Modify Backup File Name<div><p>Just FYI, I have written and posted the extension in Java here <a href="http://help.infinitekind.com/discussions/suggestions/11524-improvements-to-backups">http://help.infinitekind.com/discussions/suggestions/11524-improvements-to-backups</a>.</p></div>whitedavidp