Apple Automator (or similar): performing workflow triggered by shutdown? I was thinking about turning my desktop into a git repository that automatically syncs with BitBucket. The idea is that, periodically, the desktop is synced as well as automatically before it shuts down, i.e.: shutdown -&gt; sync -&gt; when sync is finished, actually shut down.
Is it possible to do something like that? Just an idea that I had a second ago but I couldn't find the right tools to implement it right away.
Triggering events on shut down is unlikely to be reliable. macOS is not designed to interrupt or pause the shut down process.
If a user is logged in, graphical applications can inadvertently cancel or delay shut down. This behaviour typically occurs when a modal dialog is shown for an unsaved document. In this situation, the preferred solution is to auto-save the work and restore it on next launch; this is considered better than interrupting shut down.
Better to sync periodically or in reaction to changes to a set of files.