How can I automatically eject volumes I no longer use?
Thanks to patrix, I now have it working.  I will post something here for others who want to do this in the future.

It seems that cronjob is no longer recommended, instead launchd.  This was the first time I wrote a launch agent, so there were many errors before I got it to work.  I could not decipher the error messages in the System log, but at least when they were there it told me it was not working.

I found a tutorial for a launch agent on robots.thoughbot.com. Some of the ways he uses launchctl are marked "legacy" by Apple, but they still worked for me in Sierra.

Here is my launch agent plist:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.gae.umount1&lt;/string&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
        &lt;string&gt;diskutil&lt;/string&gt;
        &lt;string&gt;unmount&lt;/string&gt;
        &lt;string&gt;force&lt;/string&gt;
        &lt;string&gt;/Volumes/3D&lt;/string&gt;
    &lt;/array&gt;
    &lt;key&gt;StartInterval&lt;/key&gt;
    &lt;integer&gt;10800&lt;/integer&gt;
&lt;/dict&gt;
&lt;/plist&gt;


It is supposed to execute the Unix command diskutil unmount force /Volumes/3D every 10800 seconds (= 3 hours).