Export Daily Backup Script crashes

I have bene trying to do an Export daily Backup of a particular database and the system just spins with a beachball and never completes. The eventual error is “DEVONthink 3 got an error: AppleEvent timed out.”

The database is one in which I have dragged mail messages in to specific folders for an archive and it contains about 30K items.

I have done a verify and repair and the database is ok.

It took several tries to even see the error message as the window with the message displays behind the DT window so the appearance is that the script completed when it didn’t.

I am running on High Sierra 10.13.6

Could you please post a screenshot of File > Database Properties? Maybe the default timeout of 20 minutes (with timeout of 1200 seconds) isn’t sufficient in this case.

here you go

Thanks for the screenshot. Does File > Export > Database Archive… work? How much time does it require?

Yes that did work took something over 30 minutes to complete, not sure on exact time. I watched it for that long then I had to go feed sheep and it was done when I came back. I was only away from my desk for half an hour so it took less than an hour total but more than half an hour.

Which brings up a question on backup practices. What are the current recommendations?

I have been doing monthly verify and repair on all my databases and weekly export daily backup archives. The archives get moved to offsite storage weekly. I also use Time Machine but have had issues when restoring DT databases from that so I don’t depend on that for the DT backups. I do a bootable clone nightly after I’ve shut down all running apps as well and once a month one goes to an offsite location. I am also in the process of implementing a long term (multi-year) backup into AWS services but that isn’t in place yet.

I’d love a way to automate the export backups by setting some sort of script that would fire off on a schedule I choose.

There’s no issue I see with your methods.

We strongly advocate proper primary backups using TimeMachine (or similar snapshot-style backup applications) and external drives. Also, you should read the recent series of articles we posted: https://www.devontechnologies.com/search?q=backups&from=blog​

That’s indeed very slow, I just tried this using a database of comparable size and it took about 150 seconds. What kind of computer do you use and how much RAM does it have?

2013 iMac running High Sierra 10.13.6 with 16GB RAM

Does the iMac have a hard disc, a fusion drive or an SSD?

1TB Hard drive with about 170GB available.

I would also like to explore this option.

We could create a smart rule to launch the script “Daily Backup Archive”. However, if we wanted the rule to be triggered daily or weekly, it’s unclear when exactly that would happen. I’d love to be able to specific “do this rule weekly, on mondays, when I quit”. Is that possible?

If not, than I was thinking of this workflow:

  1. Create a smart rule to launch the script “Daily Backup Archive” on Quit
  2. Modify the script to first check ~/Backup to see if an older backup exists
  3. If an older backup file exists, strip out the date from its filename (e.g. “Business 19-12-11.dtBase2.zip”)
  4. Check that date, and if it is older than a week, create a new backup

A couple things I’m not sure how to do yet:

  • Need the code to find that file, get its filename, and strip out the date
  • Would like a way for the script to backup all open databases, not just the active one

Bumping this because I am still have consistent crashes. Now to make matters worse the I now have a database that will not verify or optimize and crashes when I try to rebuild the database.

Have you opened a support ticket for the crashes?
If not, hold the Option key and choose Help > Report bug to start a support ticket.

I did when it first was reported but I never heard anything back. I’ll go start a new one.

Took a bit to get that done, I tried a few more things and sent additional info on the behavior of the 2 databases giving me problems.

Sorry to resurrect this topic but I’ve just ran into exactly the same problem:

I’m trying the script that ships with DT: Export/Daily Backup Archive. The DB in question contains mostly image files (49GB). I’ve been able to archive other (smaller) databases, but this one generates an error message: ‘Apple Event timed out’. There is in fact a zipped file created, but I don’t know how to check if this is a complete archive file or somehow unsound. It takes quite a long time to run the script, perhaps 20 minutes or so. I’m on an Intel Mac Mini 2018 (3.2 Core i7; 16GB ram). I’m on Cataline 10.15.7. What to do?

Screenshot 2022-03-07 at 15.08.08

That’s the timeout used by this script (AppleScript’s default timeout is one minute). Customizing the script to use a larger timeout should fix this.

Thank you for quick reply! I assume it’s this line

with timeout of 1200 seconds

Is there an upper limit or I can enter whatever seems to give me the time that I need?

Thanks! S.

I’ve answered my own question, I’ve set the time-out to 3600 seconds just now, and the script has completely successfully. Thanks again – I just learned to edit my first Apple script today! :face_holding_back_tears:


The script of the next release will use a longer timeout too.