I write a maintenance script with different commands. the script has sudo commands inside.
Now I want to use crontab, but my first problem is: How can I use the script on user level without root privilegs? Is that possible?
After that I want to copy the script on /usr/local/maintenance and want to use crontab to run the script every first thursday f.e.
EDIT: ok, I decide it now for launchD. Now I have a plist in Global Agents, it works fine. But only the user files. How can I use launchD for sudo commands?
rm -rf ~/Library/Caches sudo rm -rf /System/Library/Caches