Files
Alte_Skripte/de.ing.Reset_Spotlight_index.sh
2026-02-16 15:05:15 +01:00

32 lines
1003 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
##########################################################################
# Shellscript : Spotlight-Indexierung auf dem Mac erneuern
# Autor : Andreas Vogel, macenterprise gmbh, 17.07.2019
# Description : Wenn das Durchsuchen des Mac-Computers nicht zu den
# gewünschten Ergebnissen führt, kann eine Erneuerung
# der Spotlight-Indexierung hilfreich sein.
##########################################################################
# disable indexing of the root volume
mdutil -i off
echo "Indexing wurde deaktiviert"
# reset the data cache for your Macs hard drive:
mdutil -E /
echo "Index wurde gelöscht"
#re-indexing your hard drive
mdutil -i on /
echo "Indexing wurde wieder aktiviert"
/usr/sbin/jamf displayMessage -message "Der Spotlight index wurde auf deinem Gerät zurückgesetzt. Es kann einige Stunden dauern, bis die Festplatte vollständig neu indiziert ist und Spotlight die Gewünschten ergebnisse ausgibt."
exit 0