Motivation
node_modules often contains a lot of files that change frequently, which can significantly slow down backup solutions like Time Machine, so it would make sense to exclude them from backups.
How
Current Behaviour
node_modules folders are included in Time Machine backups
Desired Behaviour
Exclude node_modules from Time Machine backups using a "sticky exclusion". This can be done by adding the xattr com.apple.metadata:com_apple_backup_excludeItem to the node_modules folders with the value com.apple.backupd encoded as a binary plist:
00000000 62 70 6C 69 73 74 30 30 5F 10 11 63 6F 6D 2E 61 |bplist00_..com.a|
00000010 70 70 6C 65 2E 62 61 63 6B 75 70 64 08 00 00 00 |pple.backupd....|
00000020 00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 00 |................|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 1C |.............|
0000003d
References
Rust already does this for their target folders: rust-lang/cargo#4386
My PR for implementing this for the poetry Python package manager: python-poetry/poetry#4599
Motivation
node_modulesoften contains a lot of files that change frequently, which can significantly slow down backup solutions like Time Machine, so it would make sense to exclude them from backups.How
Current Behaviour
node_modulesfolders are included in Time Machine backupsDesired Behaviour
Exclude
node_modulesfrom Time Machine backups using a "sticky exclusion". This can be done by adding the xattrcom.apple.metadata:com_apple_backup_excludeItemto thenode_modulesfolders with the valuecom.apple.backupdencoded as a binary plist:References
Rust already does this for their
targetfolders: rust-lang/cargo#4386My PR for implementing this for the
poetryPython package manager: python-poetry/poetry#4599