DEV Community

Cover image for dropboxignore: it's all about the missing .dropboxignore file
Panagiotis Simakis
Panagiotis Simakis

Posted on

dropboxignore: it's all about the missing .dropboxignore file

The "Problem"

A common issue/request about Dropbox was about ignoring files without using Selective Sync. Dropbox recently introduced the ability to ignore specific files or folders. Although the significance of the new feature, many users [1,2,3,4] have expressed the importance of ignoring files from Dropbox using

In computer programming, glob patterns specify sets of filenames with wildcard characters. For example, the Unix Bash shell command mv *.txt textfiles/ moves all files with names ending in .txt from the current directory to the directory textfiles. Here, * is a wildcard standing for "any string of characters" and *.txt is a glob pattern. The other common wildcard is the question mark (?), which stands for one character. For example, mv ?.txt shorttextfiles/ will move all files named with a single character followed by .txt from the current directory to directory shorttextfiles, while ??.txt would match all files whose name consists of 2 characters followed by .txt.

just like .gitignore. For various reasons Dropbox doesn't seems to have the will to implement such feature :/

The walk-around

Alt Text

As a result, I decided to implement

GitHub logo sp1thas / dropboxignore

It's all about the missing .dropboxignore file.

dropboxignore

dropboxignore-logo

It's all about the missing .dropboxignore file.

<a target="_blank" rel="noopener noreferrer" href="https://github.com/sp1thas/dropboxignore/workflows/Testing/badge.svg"><img src="https://github.com/sp1thas/dropboxignore/workflows/Testing/badge.svg" style="max-width: 100%;"></a>
<a target="_blank" rel="noopener noreferrer" href="https://github.com/sp1thas/dropboxignore/workflows/Shellcheck/badge.svg"><img src="https://github.com/sp1thas/dropboxignore/workflows/Shellcheck/badge.svg" style="max-width: 100%;"></a>
<a href="https://dropboxignore.readthedocs.io/en/latest/?badge=latest" rel="nofollow">
    <img src="https://camo.githubusercontent.com/e2e76ed8c62aa1969c7956a879cdafb85de5120a91e9adc74970ac08998a0f9c/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f64726f70626f7869676e6f72652f62616467652f3f76657273696f6e3d6c6174657374" alt="Documentation Status" data-canonical-src="https://readthedocs.org/projects/dropboxignore/badge/?version=latest" style="max-width: 100%;">
</a>
<a href="https://snapcraft.io/dropboxignore" rel="nofollow">
    <img alt="dropboxignore" src="https://camo.githubusercontent.com/226213ae53b361a1de6b1021b5e74a1d772949d3022da2c2a4eba8521a68eb92/68747470733a2f2f736e617063726166742e696f2f64726f70626f7869676e6f72652f62616467652e737667" data-canonical-src="https://snapcraft.io/dropboxignore/badge.svg" style="max-width: 100%;">
</a>
<a target="_blank" rel="noopener noreferrer" href="https://camo.githubusercontent.com/a809edb0419372e5b894716844775503c12674d10b13d2d716af3d3bd53581c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d676f6f676c652d253233343238354634"><img src="https://camo.githubusercontent.com/a809edb0419372e5b894716844775503c12674d10b13d2d716af3d3bd53581c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d676f6f676c652d253233343238354634" data-canonical-src="https://img.shields.io/badge/code%20style-google-%234285F4" style="max-width: 100%;"></a>
Enter fullscreen mode Exit fullscreen mode


Exclude files from your dropbox using glob patterns and take advantage of existing .gitignore files.

This is a simple shell script that can be used to ignore files from dropbox using glob patterns, .dropboxignore files and the already existing .gitignorefiles. The shell script uses this approach to ignore the matched files.

Features

  • Ignore folders or files based on glob patterns inside the .dropboxignore file.
  • Automatically generate .dropboxignore files based on existing .gitignore files.
  • Ignore specific folders or files via CLI.
  • Revert ignored folders or files
  • Delete .dropboxignore files
  • Update .dropboxignore files when changes are detected in corresponding .gitignore files.
  • List ignored files and folders

Getting Started

Basic Installation

dropboxignore is installed by running one of the following commands in your terminal. You can install this via the command-line with either curl, wget or another similar tool. attr and git package should…

which is a simple shell script that ignores files from Dropbox based on glob patterns. Additionally, existing .gitignore files can be used to automatically generate .dropboxignore files.

The main difference between dropboxignore and the other relevant projects:

GitHub logo rozbb / DropboxIgnore

An ignore file like .gitignore but for Dropbox

GitHub logo swapagarwal / dropbox_ignore

🔥 .gitignore for Dropbox!

GitHub logo ridvanaltun / dropbox-ignore-anywhere

A tool for help you to ignore files and folders in Dropbox.

GitHub logo MichalKarol / dropboxignore

Tool allowing for watching sync directory and setting Dropbox to ignore paths using .dropboxignore

GitHub logo mweirauch / dropignore

A tool to conveniently ignore files and folders from Dropbox sync.

is the fact that dropboxignore is implemented using shell and the minimum requirements (attr package is the only requirement)

dropboxignore is currently available only for Mac and Linux and has various features:

  • Ignore/Revert specific files
  • Automatically update .dropboxignore
  • Revert all ignored files
  • Updated .dropboxignore based on changes in .gitignore file.

You can find more usage examples [here](https://github.com/sp1thas/dropboxignore#examples]

Things to not expect from dropboxignore:

  1. Automatically ignore new matching files.

When a new file has been created and is matched by a .dropboxignore file, user should re-ignore matching files. A cronjob could solve this drawback.

  1. Automatically detect deletions from .gitignore files

Current implementation can detect and update .dropboxignore file if an extra pattern has been added in the corresponding .gitignores but it can not handle deletions in the same way.

Discussion (0)