How can I create scheduled incremental back ups with Export?


Does anyone have any ideas about this…?

Seems like an important feature that many of us DTP users could use!

Would appreciate any ideas or suggestions about how to do this.


Perhaps this isn’t a feature widely in demand?

It ought to be possible with Keyboard Maestro, QuickKeys, etc. Though, I don’t think the Export verb in DEVONthink’s AppleScript dictionary creates a folder structure so you might want to check on that.

Couple of thoughts. If it’s a back up you need (but not necessarily wanting to see the group structure of your database duplicated in the filesystem and visible in Finder) then a good backup strategy that backs up the entire .dtBase2 package for your database(s) is perhaps all you need.

If it’s important to see the group structure replicated in Finder, then perhaps indexing (combined with Time Machine and a good, second level, backup strategy) is something to consider.

File > Export > Database Archive… as well as similar script commands at Scripts > Export (DEVONthink Pro and Pro Office only) produce complete zipped archives of databases including all database files for metadata and all document files. As such, these are not incremental updates. A database archive is the smallest possible complete storage file for backup purposes (it doesn’t include copies of internal Backup folders).

An important feature of the routines that produce database archives is that they first check the database for errors and will stop and notify the user, rather than blindly producing a backup file of a database that has problems. For that reason, as well as the compact size, this is the backup format that I use for offsite storage of my backups.

There’s a downside to making database archives. Although DEVONthink creates the backup files quickly, it will then take minutes to compress large databases as zipped files. If one were to attempt to automate the procedure for making database archives of a series of databases, provisions would have to be made to prevent timeout errors.

I also use Apple’s free backup routine, Time Machine. Time Machine is smart enough to make incremental backups, and can do so on a scheduled basis or at the user’s discretion. However, Time Machine doesn’t check database integrity in the process, so if a database has errors, so will the backup. To mitigate that issue, the user could of course once in a while run Tools > Verify & Repair to check for errors - I do this at least every few days, or after making major changes to a database (and never find errors). The most trustworthy backups made by Time Machine are with closed databases. The reason is that it’s possible that DEVONthink might be holding or processing data in RAM at the time of a Time Machine backup, so that not all data has yet been saved to disk at the time of the backup. However, in tests I’ve never found serious problems with backups made with open databases; it’s certainly preferable to have such backups than not to have backups at all!

Apple has made TIme Machine very convenient, as scheduled backups are made in the background (and the price is right). There are a number of other backup utilities, although not all of them can properly handle the contents of package files such as DT Pro/Office databases. Given the low cost of an external drive that can save backups, there’s no excuse not to keep external backups of databases that are important to the user.

Thanks very much for these wonderful replies - I greatly appreciate it!

To give a fuller explanation for why I’m seeking this solution… In short, I’ve been seeking a way to back up the contents of the DT databases so that I’d have access to the raw contents – i.e., the files and their corresponding folders – w/o being dependent on the databases themselves. I’ve been seeking this solution in the event that: the databases become corrupted or DT fails for whatever reason.

We’ve all had apps fail on us before. Right now, I cannot access any of the files I work on w/o access to DTP - the app or these databases themselves. Despite all of the wonderful preventative measures that DTP has put in place to preserve and maintain databases, I’ve had other databases fail on me before…it certainly could happen before. Right now, I’m wholly reliant on DTP and the databases, and that makes me nervous. So, to that end, I thought that apart from maintaining the regularly DTP back ups, I’d be well served to have another, auxiliary back up of my files and corresponding folders (which is important! since a mass of disordered files would be a disaster as well) for the aforementioned reasons.

By the way, I do use TimeMachine all the time, but I have the hardest time using it to navigate into DTP to find and restore files. (Maybe you could offer some tips about how to use TimeMachine more effectively for this purpose!) That’s yet another reason why I’ve been seeing a kind of scheduled incremental back up for Export->Files and Folders?

Does that make sense?


Perhaps indexing your document in DEVONthink is the best approach given the risk profile you describe. WIth indexing you would be leaving your folder structure intact in the filesystem, and easily accessed with Finder, etc.

Outside of Time Machine, you control-click a database (*.dtBase2), select Show Package Contents, and browse the “files.noindex” folder inside the database package. Not possible in TIme Machine, unless you’re directly browsing the folder structure on your Time Machine drive.

BUT, don’t restore a file from one database package directly into another database package. Best case, the restored file will show up as an orphan. Worst case, the database will get corrupted.

Thanks. Believe me, I’ve considered it. But it seems like Indexing would add a whole other layer of complication… It would make importing much more complicated, clunky, and confusion. I would lose some important features, like replication, etc. Hence my dilemma…and my need to find an additional way of backing up DTP files with their corresponding folders.

I don’t have my TimeMachine HD next to me right now, but as I recall…I’ve tied this, and I still couldn’t use the navigation you’ve described to locate a particular file w/in a DTP database. Did I overlook a step (or totally screw it up) or am I highlighting a DTP shortcoming?

Thanks again!

What I meant is that it’s not possible to view package contents using the standard Time Machine interface in OS X. Finding any file by browsing the Time Machine drive directly is a pita. Spotlight doesn’t help.

Has nothing to do with DEVONthink. Most people never browse inside packages (or even know what “packages” are), Time Machine doesn’t dissect packages and do incremental backups of their contents, and so Apple just left “Show Package Contents” out of the Time Machine interface.

Not exactly. Replication, duplication, labeling, tagging, etc., all work with indexed documents.

Perhaps this can be done using AppleScript?

Then use something like Hazel or Keyboard Maestro that will trigger the applescript?

Ok, so what then is a more effective way to use TimeMachine w/ DTP so I can locate and restore specific files?

So what features does one loose when using Indexing v. Importing? Thanks!

Not ideal, but I could work w/a solution that interfaces w/ Hazel. Thanks!

Perhaps this script will help.

[url]Need help with an export script]

Thanks! But can someone provide a bit more guidance w/ how to use it? My understanding of setting up scripts is very limited, so I’d appreciate whatever help you can provide. Thanks!

Note that the OP’s original requirements were “scheduled” and “incremental” backups. The script mentioned above will do exports on demand – not on schedule, and not incremental. AFAIK, there is no method in DEVONthink’s AppleScript dictionary to cause events to occur on a scheduled basis, and no method to (easily) examine an export directory to determine what changes are incremental.

I gotcha. Thanks for the clarification. So, I don’t expect that @TylerGred’s script will work then, correct? If not, is there a set up in which I can use an iCal alarm and Hazel to achieve approximately the same results? Thanks!

AFAIK, Hazel doesn’t work that way: it watches folders in the filesystem but not structures like groups in DEVONthink or other applications. I suppose it could monitor the .dtBase2 database package, but it would likely find that the modifcation date/time changes rapidly when you’re working in the database. Seems clunky.

Maybe something more elegant could be done with Keyboard Maestro or QuickKeys + an applescript? Rather time consuming effort to get all of @jprint714’s requirements met – and then what’s the difference between the end result and Time Machine, from a data assurance perspective?

Is there a concern that DEVONtechnologies will exit the business and DEVONthink will quit working, thus “trapping” your data? I don’t know about the former condition, but even if so it’s highly probable there would be time between that event and the time DEVONthink is non-functioning – more than enough time to make a export of your data. Never say never, but I think the risk is low that DEVONthink would immediately stop working for everyone everywhere at the same moment. :open_mouth:

You can read a little here…

I do believe that if you spend some time playing around and reverse engineering various scripts, you’ll begin to build something that will suit your needs. Korm suggested that I try automator, in my applescript thread, and that is another possible tool. While I’m still very (VERY) ignorant when it comes to applescript, one of the best tools for learning how to use AppleScript with DTP is to just open up the DTP scripts. My Export script consisted of a lot of lines from Export>Daily Backup script that comes with DTP. Just be sure to backup the original scripts, in case you screw something up.

I don’t think DEVON Technologies is going anywhere, anytime soon, so I do agree with Korm that you will have plenty of time to export all data when needed. However, I still would like to see a feature like this someday, implemented in DTP or DTP Office.

Just wondering if there have been any more developments / improvements with this back up setup…