If you're checking this in or after 2020, you can follow the official way to ignore a file/folder from syncing to dropbox from your computer.
Although, at the time of writing this post, the feature is still in Beta.
https://help.dropbox.com/files-folders/restore-delete/ignored-files
ignoring
is different from excluding
.
- Dropbox
exclude
removes the folder from your machine altogether. The file/folder does, however, stay on Dropbox's servers. Excluded folders can be included back onto your machine whenever you choose by going to the dropbox app's settings.
ignore
lets you keep the file or folder on your machine but doesn't sync the file or folder to Dropbox at all. That means the folder only lies on your current machine and not on Dropbox.
For example:
You would choose dropbox exclude
to exclude a big backup file that you don't have space for or don't need on your machine. The file/folder will still exist on Dropbox.
You would choose to ignore
folders from syncing to dropbox when your folder contains thousands or millions of temporary files that aren't necessary to be backed up. Backing up such a folder could cause Dropbox to use a lot of CPU cycles and RAM on your computer to keep track of all the changes to your files. This might slow down your computer.
An example of such a folder is node_modules
which get installed in a node project directory. node_modules
have quite a number of files within them which can be safely ignored from syncing to Dropbox and recreated by doing a npm install
at any point in time.
You might also choose to ignore environment variable files containing secret keys to your web server or your ssh private keys. This could be useful while sharing folders across teams on Dropbox.
How to Exclude:
- To exclude a file from syncing from dropbox to your computer, you would need to either:
- All platforms: Change the folders to sync in the
selective sync
settings in the Dropbox app.
- Linux Dropbox CLI: Or run the command
dropbox exclude add "FULL_PATH_TO_FILE_OR_FOLDER_TO_EXCLUDE"
in your terminal.
How to Ignore
To ignore a file from getting synced from your computer to Dropbox, you'd need to run the following commands in the terminal while changing the FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX
in the commands below to the file/folder you need to exclude:
Mac:
alias dropboxignore="xattr -w com.dropbox.ignored 1"
dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
Linux:
alias dropboxignore="attr -s com.dropbox.ignored -V 1"
dropboxignore "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
Windows - Powershell:
Set-Content -Path "FULL_OR_RELATIVE_PATH_TO_FILE_IN_DROPBOX"
-Stream com.dropbox.ignored -Value 1