Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dev01d/tm-exclude
:computer: Automatically exclude dev dependancies from Time Machine backups
https://github.com/dev01d/tm-exclude
apple backup backups development-environment time-machine
Last synced: about 1 month ago
JSON representation
:computer: Automatically exclude dev dependancies from Time Machine backups
- Host: GitHub
- URL: https://github.com/dev01d/tm-exclude
- Owner: dev01d
- Created: 2019-02-07T07:17:50.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-02-06T02:59:15.000Z (almost 3 years ago)
- Last Synced: 2023-03-05T22:16:41.616Z (almost 2 years ago)
- Topics: apple, backup, backups, development-environment, time-machine
- Homepage:
- Size: 13.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Time Machine exclude [![version badge](https://img.shields.io/github/release/dev01d/tm-exclude.svg?style=flat)](https://github.com/dev01d/tm-exclude/releases)
This is a `launchd` plist wrapper that uses `find` and `tmutil` to recursively search for and exclude specified directories from your Time Machine backups.
> This example is for the node_modules directory but will work on any other reoccurring dev dependency.
This plist watches each directory specified for state change, runs and then sleeps for 30 seconds so the system doesn't throttle it.
## Usage
- Open with Xcode or any text editor
1. Edit the variable `WORKINGDIR=$HOME/your-working-dir` so it points to the parent folder of your working directory
2. Edit the string under `WatchPaths` and be sure to include trailing slash
- Multiple `~/directory/to/monitor/` entries supported
3. Move plist to `~/Library/LaunchAgents/`
4. Load config with this command
```bash
launchctl load ~/Library/LaunchAgents/com.user.time-machine-exclude.plist
```- Done.
Whenever a monitored directory's state changes the script will run removing old exclusions then adding new ones
## Example
```shell
~/Code
├── Go
├── JavaScript
├── K8s
├── Python
└── Websites
```- `WORKINGDIR=$HOME/Code` for the above location
Then dirs to watch (WatchPaths) would be:
- `~/Code/JavaScript/`
- `~/Code/Websites/`## Test
To see if the plist was effective run this command.
```bash
WORKINGDIR=$HOME/your-working-dir \
&& find $WORKINGDIR -type d -name node_modules -prune -exec tmutil isexcluded {} +
```**Note:** I haven't noticed any absurd resource usage but for those concerned please see [v1.0.0](https://github.com/dev01d/tm-exclude/releases/tag/1.0.0).