Skip to content

Instantly share code, notes, and snippets.

@mynyml
Last active September 18, 2020 04:13
Show Gist options
  • Save mynyml/2bec3cb2202c4479943046a3999156e3 to your computer and use it in GitHub Desktop.
Save mynyml/2bec3cb2202c4479943046a3999156e3 to your computer and use it in GitHub Desktop.
Mark files to be ignored by dropbox based on pattern. Example with node_modules directories.
# ignore `node_modules` directories recursively.
# see https://help.dropbox.com/files-folders/restore-delete/ignored-files
# apt install attr
LC_ALL=C find . -type d -regextype posix-extended -regex '.*/node_modules' -prune 2> >(grep -v 'Permission denied' >&2) | while read -r path; do attr -s com.dropbox.ignored -V 1 "$path"; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment