Auto-Excluding Folders from Time Machine via Terminal
Time Machine’s graphical interface lets you exclude folders one at a time by dragging them into the “Exclude these items” list, but this quickly becomes tedious if you have many cache folders, build directories, or virtual machine files that don’t need backing up. The tmutil command-line tool gives you far more precise and scriptable control, which is especially valuable for developers dealing with things like node_modules, Docker volumes, or Xcode’s DerivedData folder — all of which can balloon your backup size without adding any real value.