Created
December 27, 2022 14:42
-
-
Save zxt-tzx/db624b428de1449032b0fdd34c9cc597 to your computer and use it in GitHub Desktop.
prioritise iCloud syncing processes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
bird_pid=$(pgrep bird) | |
cloudd_pid=$(pgrep cloudd) | |
nsurlsessiond=$(pgrep nsurlsessiond) | |
# check all the values are not empty | |
# refactor to not use [[ ]] and use [ ] instead | |
if [[ -z "$bird_pid" || -z "$cloudd_pid" || -z "$nsurlsessiond" ]]; then | |
echo "bird, cloudd or nsurlsessiond is not running" | |
exit 1 | |
fi | |
for pid in $bird_pid; do | |
renice -n -10 -p "$pid" | |
done | |
for pid in $cloudd_pid; do | |
renice -n -10 -p "$pid" | |
done | |
for pid in $nsurlsessiond; do | |
renice -n -10 -p "$pid" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment