Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Last active March 7, 2024 01:43
Show Gist options
  • Save nickcernis/bb4bd43a44efd73b87d857e29b1d5b96 to your computer and use it in GitHub Desktop.
Save nickcernis/bb4bd43a44efd73b87d857e29b1d5b96 to your computer and use it in GitHub Desktop.
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />

Notes

It can take one to eight hours before new files are backed up. If you want to test this has worked, best to wait a day or so. https://help.backblaze.com/hc/en-us/articles/217665498-Why-hasn-t-Backblaze-backed-up-my-new-files-yet-

Adding this rule does not appear to remove existing node_modules folders that have already backed up. Options to delete existing node_modules folders are here: https://help.backblaze.com/hc/en-us/articles/217666658-How-can-I-delete-files-that-have-already-been-uploaded-

You may wish to also exclude .git folders with the extra exclusion rules described here: https://gist.github.com/jb510/7f52f0f4c13020b56e30ac72eb733efb

References

@alexhrao
Copy link

alexhrao commented Aug 7, 2020

Thank you!

@tomprogers
Copy link

Solid.

@mwyld
Copy link

mwyld commented Jan 2, 2021

Perfect!

@himynameisjonas
Copy link

Thanks!

@dani-z
Copy link

dani-z commented Mar 23, 2021

I was looking for something like this. Thanks so much!

@kevnk
Copy link

kevnk commented Apr 28, 2021

Thank you!

@E-VANCE
Copy link

E-VANCE commented Jun 2, 2021

Much appreciated!

@supernovaplus
Copy link

Great!

@G3z
Copy link

G3z commented Dec 1, 2021

awesome

@marcomessa
Copy link

Thank you!

@spookyuser
Copy link

def the 2nd time i've visited this page, ty!

@danawoodman
Copy link

me bringing this man a beer:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment