Fix OneDrive for mac.

Automatically reset OneDrive app - on Apple Mac - which is misbehaving, such as not syncing.

The following steps were recommended by Microsoft OneDrive support, and tested successful by the author, with no side effects, othen than having to re-sign in to the OneDrive app, and reselecting certain directories to exclude form sync

Steps performed by this script, in order:

Quit the OneDrive application, if it's running (using osascript)

Delete ~/Library/Containers/ (recursive, forcefully).

Delete ~/Library/Containers/ (if it exists).

killall -SIGTERM cfprefsd.

wait just a second ...

Restart the OneDrive application (open -a OneDrive)

Read More