No spam. Not selling anything. Max 1-2 newsletters a month.

Kaveh's Blog logo

Personal blog

Kaveh Tehrani

A bash script to easily exclude directories from Dropbox sync using pattern matching

Published on
1 mins read

I code a lot in the my dropbox folder to keep them synced across my devices (before git commits are viable) and unfortunately dropbox does not include an automatic way to exclude syncs. Each "node_modules" or "debug" folder contains potentially thousands of small files and syncing them is a waste of time and disk space. What's worse, dropbox falters when there are many thousand small files to sync and ends up halting (see here), at least on linux distros I am using.

I wrote this script to help me exclude directories from syncing. I have set up a job in cron to run every 5 minute and exclude pesky large folders that should not be synced in the first place.

Moved it over to a repo for easier sharing and updating: dropbox-exclude