2

While exporting some mailboxes via Apple Mail in macOS, the mail client itself unfortunately does not show the progress of this operation. The only way to know if it's done is when the resulting directory no longer has ".partial" as a substring of its name.

Calling du -sh in this directory can somehow report the progress of the operation, but it's manual and tedious. Is there another command line tool that would ease the process of actively monitoring this until the operation has completed?

1 Answers1

0

As explained in the first answer of Is there a command like "watch" or "inotifywait" on the Mac?, you can use fswatch.

Install it via Homebrew with:

brew install fswatch

You can then watch for the deletion of the .partial file with:

fswatch --event Removed myfile.partial | xargs -n1  ./change.sh

where the content of the change.sh script is:

#!/bin/bash
echo Operation terminated

Note: The -n1 option of xargs allows to launch the change.sh script after fswatch outputs one event.