# @bdsx/backup

> Plugin to back up Bdsx Bedrock Minecraft servers

Latest version **1.1.0** (published 2021-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bdsx/backup
pnpm add @bdsx/backup
yarn add @bdsx/backup
bun add @bdsx/backup
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-12-09 |
| First published | 2021-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 51.1 KB |
| Known vulnerabilities | 0 (+8 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Author | LastSandwich |
| Maintainers | lastsandwich |

## Links

- npm: https://www.npmjs.com/package/@bdsx/backup
- Repository: https://github.com/LastSandwich/bdsx-backup
- Homepage: https://github.com/LastSandwich/bdsx-backup#readme
- Issues: https://github.com/LastSandwich/bdsx-backup/issues
- npm.io page: https://npm.io/package/@bdsx/backup

## Dependencies (4)

- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.5.3
- [@types/ncp](https://npm.io/package/@types/ncp.md) ^2.0.4
- [@types/adm-zip](https://npm.io/package/@types/adm-zip.md) ^0.4.33

## Recent versions

- 1.1.0 (latest) — 2021-12-09
- 1.0.17 — 2021-03-24
- 1.0.16 — 2021-03-24
- 1.0.15 — 2021-03-23
- 1.0.14 — 2021-03-22
- 1.0.12 — 2021-03-22
- 1.0.11 — 2021-03-22
- 1.0.10 — 2021-03-22
- 1.0.9 — 2021-03-21
- 1.0.8 — 2021-03-20
- 1.0.7 — 2021-03-20
- 1.0.6 — 2021-03-20
- 1.0.5 — 2021-03-20
- 1.0.4 — 2021-03-20
- 1.0.3 — 2021-03-20
- … 2 more at https://npm.io/package/@bdsx/backup/versions

## README

# @bdsx/backup
Backup manager for Minecraft worlds running on [Bdsx](https://github.com/bdsx/bdsx)

## How to install

1. From your Bdsx installation folder, run `plugin-manager.bat` on Windows or `plugin-manager.sh` on Linux
2. Choose `@bdsx/backup` and press `Enter` to install
3. Insert this code in your index.ts file:
````
import { bedrockServer } from "bdsx/launcher";
import { events } from "bdsx/event";
import { BackupManager } from "@bdsx/backup/BackupManager";

const backupManager = new BackupManager(bedrockServer, events);
backupManager.init({
    backupOnStart: true,
    skipIfNoActivity: true,
    backupOnPlayerConnected: true,
    backupOnPlayerDisconnected: true,
    interval: 30,
    minIntervalBetweenBackups: 5,
}).then((res) => {
    console.log(`backup manager initiated`);
});
````
You can tweak the following settings:
- backupOnStart: backup will occur when the server is started
- interval: minutes between each backup
- skipIfNoActivity: only create a backup if players have been active the previous backup
- backupOnPlayerConnected: run a backup when a player joins
- backupOnPlayerDisconnected: run a backup when a player leaves
- minIntervalBetweenBackups: minimum minutes between backups
- bedrockServerPath: path to the bedrock_server folder - defaults to `"."`

## How to run
Next time you restart the Bdsx server the backup manager should start up.

Backups will be zipped and saved in `./bedrock_server/backups`.

## Caution
This software has not been battle tested so please use with caution!

## TODO
- Provide a setting to automatically clean up old backups

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