-
-
Save osopolar/9d8e8188091f7cbbfcee924ccfbb32dd to your computer and use it in GitHub Desktop.
Exclude node_modules (and more) from 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`
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
<?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" && find $(pwd) -type d \( -name vendor -o -name node_modules \) -prune -exec tmutil addexclusion {} \; -exec tmutil isexcluded {} \;</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