# drobadi

> drobadi: a node tool to backup a given directory onto dropbox

Latest version **1.1.4** (published 2025-10-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install drobadi
pnpm add drobadi
yarn add drobadi
bun add drobadi
```

Provides the command `drobadi`.

## Health

**Score 30/100 (F)** — status: maintenance-mode.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2025-10-05 |
| First published | 2021-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Unpacked size | 60.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Boly38 |
| Maintainers | boly38 |
| Keywords | node, backup, dropbox, directory |

## Links

- npm: https://www.npmjs.com/package/drobadi
- Repository: https://github.com/boly38/drobadi
- Homepage: https://github.com/boly38/drobadi#readme
- Issues: https://github.com/boly38/drobadi/issues
- npm.io page: https://npm.io/package/drobadi

## Dependencies (7)

- [yesno](https://npm.io/package/yesno.md) ^0.4.0
- [dotenv](https://npm.io/package/dotenv.md) ^17.2.3
- [dropbox](https://npm.io/package/dropbox.md) ^10.34.0
- [archiver](https://npm.io/package/archiver.md) ^7.0.1
- [inquirer](https://npm.io/package/inquirer.md) ^12.9.6
- [unzipper](https://npm.io/package/unzipper.md) ^0.12.3
- [dropbox-refresh-token](https://npm.io/package/dropbox-refresh-token.md) ^0.0.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2025-10-05
- 1.1.3 — 2024-04-27
- 1.1.2 — 2024-04-23
- 1.1.1 — 2024-04-21
- 1.1.0 — 2024-04-15
- 1.0.2 — 2024-04-10
- 1.0.1 — 2024-04-10
- 1.0.0 — 2023-10-15
- 0.1.0 — 2023-10-14
- 0.0.13 — 2023-01-06
- 0.0.12 — 2022-04-18
- 0.0.11 — 2022-03-22
- 0.0.10 — 2022-01-24
- 0.0.9 — 2021-12-12
- 0.0.8 — 2021-11-12
- … 5 more at https://npm.io/package/drobadi/versions

## README

# drobadi

Dropbox backup directory

A Node.js tool to 
- zip a directory and create backup onto Dropbox, 
- list backups, 
- download a backup
- or download and unzip a backup.

[![NPM](https://nodei.co/npm/drobadi.png?compact=true)](https://npmjs.org/package/drobadi)


## Command line usage

### Setup
**install drobadi**

```
pnpm install drobadi@latest --global
```

**set your preferences**

A dropbox application (`dropboxAppKey`,`dropboxAppSecret`), and long-lived refresh-token (`dropboxRefreshToken`) are required.

NB: in order to understand how-to get a `refresh-token, cf [dropbox-refresh-token](https://github.com/boly38/dropbox-refresh-token)

The old-long-lived access-token (`dropboxToken`) are always supported but this method is deprecated and will be removed in futur release.

```
drobadi setup
```
_(first time only) create a drobadi config file `~/.drobadi`_

To remove this setup
```
drobadi unlink
```

NB: you could create other custom drobadi config files, and choose custom drobadi config file by using `DBD_CONFIG_FILE` env.

### Show help
- `drobadi`

_show actions_

### Create a backup
- `drobadi backup <localDirectory> [<myBackup.zip>]`

_create a remote zip backup from local directory_

Example: zip local directory `../tmp/backup/myDir` then upload as dropbox backup `/backup/biolo.zip` 
```
drobadi backup ../tmp/backup/myDir biolo.zip
```

This action will success if the target dropbox already exists with the same zip file.

This action will fail if a different target dropbox already exists (use `forceBackup` to override it).

`backup` is the default dropbox backup target directory and may be changed using options.

### Create or override a backup
- `drobadi forceBackup <localDirectory> [<myBackup.zip>]`

### List backups

- `drobadi list`
- `DBD_CONFIG_FILE=./tmp/myDrobadiConfig drobadi list`

_list remote backups_


### Download a backup

- `drobadi download <myBackup.zip> [<localFile.zip>]`

_download a remote backup into local file_

Example: download dropbox file `/backup/biolo.zip` as local file `./biolo.zip`
```
drobadi download biolo.zip
```

Example: download dropbox file `/backup/biolo.zip` as local file `/tmp/ddd.zip`
```
drobadi download biolo.zip /tmp/ddd.zip
```

### Download and unzip a backup
- `drobadi downloadAndUnzip <myBackup.zip> [</local/path>]`

_download a remote backup and unzip it into local directory_

Example: download dropbox file `/backup/biolo.zip` and unzip it into local directory `./biolo`
```
drobadi downloadAndUnzip biolo.zip ./biolo
```


## DOptions
Drobadi options are
- `dropboxAppKey` (or `DBD_DROPBOX_APP_KEY` env. Default: `null`. **Required**) : [dropbox application](https://www.dropbox.com/developers/apps/) key.
- `dropboxAppSecret` (or `DBD_DROPBOX_APP_SECRET` env. Default: `null`. **Required**) : dropbox application secret.
- `dropboxRefreshToken` (or `DBD_DROPBOX_REFRESH_TOKEN`. Default: `null`.  env. **Required**) : dropbox application [refresh-token](https://github.com/boly38/dropbox-refresh-token).
- `path` (or `DBD_PATH` env. Default: `backup`) : dropbox target directory that receive backup files.
- `overrideTargetBackup` (or `DBD_OVERRIDE_TARGET_BACKUP` env. Default: `false`) : override target backup file.

Deprecated option:
- `dropboxToken` (or `DBD_DROPBOX_TOKEN` env. Default: `null`. **DEPRECATED**) : dropbox access-token value,
- `dropboxTokenDisableWarning` (or `DBD_DROPBOX_TOKEN_DISABLE_WARNING` env. Default: `false`.*) : change-it to disable warning log.

Note that `drobadi setup` help you to create a `~/.drobadi` config file.

DOptions precedence: options object, or env value or config file or default value.


## Library use

### Install dependency

You have to import as dependency
```
pnpm install drobadi
```

### Define the requirements, example:
``` 
import {Drobadi, DOptions} from "drobadi";

const dOptions = new DOptions({
    "dropboxToken": 'My dropbox token is a secret',
    "path": "from-drobadi",
    "overrideTargetBackup": true
});
let drobadi = new Drobadi();
```

### create a remote backup from local directory
```
let promiseResult =  drobadi.backup(dOptions, "./myData/", "dataBack.zip")
```

### list remote backups
```
let promiseResult = drobadi.list(dOptions);
```

### Restore remote backup in current directory
```
let promiseResult = drobadi.download(dOptions, "dataBack.zip")
```

### Restore remote backup in a given local destination
```
var promiseResult = drobadi.download(dOptions, "dataBack.zip", "/home/user/incomming/restored.zip")
```

### Restore remote backup and unzip it in a given local directory
```
var promiseResult = drobadi.downloadAndUnzip(dOptions, "dataBack.zip", "/tmp/restoreHere")
```

NB: you could also have a look at tests : [drobadi.test.js](tests/drobadi.test.js)


## How to contribute
cf [contributing guide](./.github/CONTRIBUTING.md)

### Services or activated bots

| badge  | name                            | description                                                              |
|--------|---------------------------------|:-------------------------------------------------------------------------|
| ![CI/CD](https://github.com/boly38/drobadi/workflows/drobadi-ci/badge.svg) | Github actions                  | Continuous tests.                                                        
| [![Audit](https://github.com/boly38/drobadi/actions/workflows/audit.yml/badge.svg)](https://github.com/boly38/ndrobadi/actions/workflows/audit.yml) | Github actions                  | Continuous vulnerability audit.                                          
| [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)| [Houndci](https://houndci.com/) | JavaScript  automated review (configured by [`.hound.yml`](.hound.yml)) |

---
_Source: https://npm.io/package/drobadi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
