Skip to content

Instantly share code, notes, and snippets.

@shollingsworth
Created March 29, 2022 17:45
Show Gist options
  • Save shollingsworth/fd3f83a26af61d41f5569519ef6625c1 to your computer and use it in GitHub Desktop.
Save shollingsworth/fd3f83a26af61d41f5569519ef6625c1 to your computer and use it in GitHub Desktop.
change inotify settings
#!/usr/bin/bash
if [[ $(whoami) != "root" ]]; then
echo "You must be root to run this script."
exit 1
fi
echo "----------------------"
echo "Existing settings"
echo "----------------------"
sysctl fs.inotify
echo "----------------------"
echo "Setting new settings"
echo "----------------------"
sysctl -n -w fs.inotify.max_user_watches=65536
sysctl -n -w fs.inotify.max_user_instances=1024
sysctl -n -w fs.inotify.max_queued_events=65536
echo "----------------------"
echo "Reloaded settings"
echo "----------------------"
sysctl -p
echo "----------------------"
echo "New Settings"
echo "----------------------"
sysctl fs.inotify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment