macOS Mojave
See: How to access a launch daemon's values/ system defaults value
macOS Sierra
On Sierra this command didn't work for me:
launchctl unload -w /System/Library/LaunchAgents/com.apple.diskspaced.plist
due to System Integrity Protection engaged, so to stop the diskspaced
service, run:
launchctl stop com.apple.diskspaced
Note: Use start
to start again or list
to see the details (e.g. its PID
).
If the service is restarting after a while, try the following command to stop it:
killall -STOP diskspaced
Changing warning level and interval
To change the user's default settings, here are some example commands:
defaults write com.apple.diskspaced freeSpaceWarningLevel 1
defaults write com.apple.diskspaced warningInterval 3600
defaults write com.apple.diskspaced debugLog 1
defaults write com.apple.diskspaced checkAllVolumes 0
Then restart the service:
launchctl stop com.apple.diskspaced && launchctl start com.apple.diskspaced
To see the loaded settings, run diskspaced
, e.g.:
$(find /System/Library/PrivateFrameworks -name diskspaced -print -quit)
2017-08-04 18:32:27.943 diskspaced[92401:12312556] FreeSpaceWarningLevel: 1
2017-08-04 18:32:27.943 diskspaced[92401:12312556] WarningInterval: 3600
2017-08-04 18:32:27.943 diskspaced[92401:12312556] Check All Volumes: NO
Notes
I believe parameters mentioned by @malhal no longer exist. Here is a simple command to test this:
$ grep -A6 debugLog <(strings $(find /System/Library/PrivateFrameworks -name diskspaced -print -quit))
debugLog
freeSpaceWarningLevel
FreeSpaceWarningLevel: %ld
warningInterval
WarningInterval: %ld
checkAllVolumes
Check All Volumes: %@
Troubleshooting
Check the logs by this command for any warnings:
grep com.apple.diskspaced /var/log/system.log