Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Exclude node_modules in timemachine, use launchd to scan the Project directory on a regular basis, for example meanwhile you are having siesta. Put this file in ~/Library/LaunchAgents and call `launchctl load ~/Library/LaunchAgents/com.user.time-machine-exclude-node-modules-job.plist`
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.time-machine-exclude-node-modules-job</string>
<key>RunAtLoad</key>
<false/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-c</string>
<string>cd "$HOME/Projects" &amp;&amp; find $(pwd) -type d -name node_modules -maxdepth 8 -exec tmutil addexclusion {} \;</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>13</integer>
<key>Minute</key>
<integer>15</integer>
</dict>
<!-- Debug logging -->
<!--
<key>StandardOutPath</key>
<string>/tmp/launchd.log</string>
<key>StandardErrorPath</key>
<string>/tmp/launchd.log</string>
-->
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.