DT3 does not update an indexed folder when the folder's content changes

Coming from How to Trigger a Smart Rule on File Changes in an Indexed Folder I have the problem that an indexed external folder in DT3 does not update when changed outside even after long waiting.

Here detailed steps about what happened:

  • A while ago I have a folder added as an indexed folder to a database.
  • The files in that folder (PDFs and ePUBs) appear now in DT3
  • I now delete the files (but keep the folder). Afterwards I check the folder in Apple’s Finder: Indeed empty.
  • Then I wait. And check the folder in DEVONthink: Still full with the documents! (But when I preview a document it now says “File missing”.)
  • I wait longer. Over night. And the folder appears in DEVONthink 3 still with the documents. Only in Apple’s Finder it is empty.
  • I add a new file in the Finder to that folder (with a name never been in that folder before): The new file appears in DT3 - among all the other non-existing files! In Apple’s Finder the folder contains only the one new file.

Note: This was not always like this: I do remember, a few days ago (when I started to tackle indexing the documents in this external folder) deletions and changes to the files in the folder were picked up by DT3, but now they are not noticed anymore.

What to do to avoid a situation like this? The files have to be in this external folder.

You need to be specific about the details like where the external foldetr is and how the deletion is being done.

"I now delete the files* isn’t accurate if it’s a python script removing the file.

Have you tried manually deleting the file in the indexed folder?

In this test I have deleted the files indeed manually (via rm /path/to/my/folder/*).

In future the files will be deleted and then the new once copied in via a python script.

Try it in the Finder, not Terminal.
And again, where is the indexed folder?

Also, is the Trash emptied in the database?

Well, I cannot try in the Finder, because the files are already gone, but DT3 still thinks they are there. How can I force DT3 to update? (Menu entry Update Indexed Items with the folder in question selected in DT3 does not make any differnce.)

The folder is on the internal SSD at ~/Dropbox/read/calibre-books.

That is a cloud-synced location and is treated differently when indexing to avoid collisions with the cloud service’s processes.

You should try this process on a non-cloud-synced location.

1 Like

I use Dropbox to backup essentially all my stuff. (I have a 1TB account.)

How can I index a Dropbox path via DT3 - and how can I force re-indexing that location?

Again: You should try this process on a non-cloud-synced location. Do you see the same results?

You could use the synchronize record AppleScript command to update the indexed group both after deleting and after adding the file.

This sounds super-promising! Will try it out and report back.

Hi again,

I tried it and it does not work properly! :frowning:

I use the following script:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "DEVONthink 3"
	set theDB to database named "read+study"
	set theGroup to parent named "calibre-books" in theDB
	synchronize record theGroup
end tell

When after I run it DT3 still thinks 124 documents are in the folder. However the preview of the files has changed: It says now “File not yet available”. See the following screenshot of the folder ini DT3 with document preview:

In case it helps, here a screenshot of DT3’s Info pane of the folder:

And finally the Finder’s Info pane of the folder:

Somehow DT3 is stuck on having the documents in the folder.

Maybe a better idea is:

Have an Applescript which first removes the indexed folder in DT3 (but of course does nothing on the file system) and then re-adds the indexed folder.

How could I do this?

Did you try the non-cloud-synced folder as I suggested?

I have tried a non-cloud location and it works. Plus I have tried another Dropbox location and it works too.(*)

That was the situation with the location in question (~/Dropbox/read/calibre-books) as well: It did work at the beginning. Just when I continued to chang the folder content again and again DT3 seems to get confused after a while.

That’s why I hope the remove/re-add approach could work.

(*): For the books folder a non-cloud location is in the long run not really an option. (As mentioned I have nearly everything as an additional auto-backup in Dropbox.)

  • Are you synchronizing the contents of indexed files in the sync location?
  • Is the Dropbox folder in the same relative location on both machines?



Just to give this thread some closure:

I didn’t find a way to resolve the issue with the folder as it was sitting on the file system. So indtead I did:

  1. Delete the folder in DT3.
  2. Emptied the trash. (Without out delte filesystem stuff.)
  3. Delete the folder on the file system.
  4. Re-created the folder and re-populated it with the documents.
  5. Added the folder as an indexed folder to DT3.

Now everything is good again. :slight_smile: I just don’t know for how long… I guess when things get out of sync I have to redo this procedure… Would be nice to have applescripts doing steps 1., 2. and 5. (I know how to do 3. and 4.)