-
Notifications
You must be signed in to change notification settings - Fork 6
/
macos_crontab
20 lines (15 loc) · 885 Bytes
/
macos_crontab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Keep your macOS system relatively clean by removing unnecessary information
# from it.
# Clean-out macOS's trash can.
@hourly /bin/rm -fr $HOME/.Trash/* &>/dev/null
@hourly /bin/rm -fr $HOME/.Trash/.??* &>/dev/null
# Scrub .DS_Store files which contain metadata about old files.
@hourly find $HOME -type f -name .DS_Store -print0 | xargs -0 rm &>/dev/null
@daily /bin/rm -fr $HOME/Downloads/* &>/dev/null
@daily /bin/rm -fr $HOME/Downloads/.??* &>/dev/null
# macOS keeps a record of all files ever quarantined/downloaded, let's clean
# that up.
@daily sqlite3 $HOME/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 'delete from LSQuarantineEvent' &>/dev/null
# Poorly written applications cannot handle missing log files, so we'll just
# null them out.
@daily find $HOME/Library/ -name "*.log" -type f -print0 | xargs -0 -J % -n 1 cp -v /dev/null "%" &>/dev/null