PHPackages                             jiannius/backup - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. jiannius/backup

ActiveLibrary[File &amp; Storage](/categories/file-storage)

jiannius/backup
===============

Jiannius Laravel package backup

v0.2.0(1mo ago)00MITPHPPHP ^8.3CI passing

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/jiannius/backup)[ Packagist](https://packagist.org/packages/jiannius/backup)[ RSS](/packages/jiannius-backup/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

Jiannius Backup
===============

[](#jiannius-backup)

[![tests](https://github.com/jiannius/backup/actions/workflows/tests.yml/badge.svg)](https://github.com/jiannius/backup/actions/workflows/tests.yml)[![lint](https://github.com/jiannius/backup/actions/workflows/lint.yml/badge.svg)](https://github.com/jiannius/backup/actions/workflows/lint.yml)

Scheduled database + files backup for Laravel apps: dump the database, zip it together with your configured folders, upload the archive to any Laravel filesystem disk, prune old archives — and email you when a backup fails.

Supports **SQLite, MySQL, MariaDB, and PostgreSQL** via [spatie/db-dumper](https://github.com/spatie/db-dumper).

How it works
------------

[](#how-it-works)

Each run produces a single timestamped archive — `{app-slug}-2026-06-03-021500.zip` — containing:

```
db.sql                      # the database dump
files//...   # every configured folder, full paths preserved

```

The archive is uploaded to the configured disk + path, then archives older than the retention period are pruned. Only this app's own archives (matching `{app-slug}-*.zip`) are ever deleted — unrelated files in a shared path are never touched.

Every failure is logged, and emailed if a notification address is configured. The command exits non-zero so your scheduler marks the run as failed.

Requirements
------------

[](#requirements)

- PHP 8.3+ · Laravel 11+ host app
- The dump binary for your database on the server: `sqlite3`, `mysqldump`, `mariadb-dump`, or `pg_dump` (set `database.binary_path` if it's not in `PATH`)

Installation
------------

[](#installation)

```
composer require jiannius/backup
```

The service provider auto-registers. Publish the config if you want to override it:

```
php artisan vendor:publish --tag=backup-config
```

Configuration
-------------

[](#configuration)

The quick knobs are env vars:

EnvDefaultPurpose`BACKUP_DISK``local`Destination disk (any disk in `config/filesystems.php`)`BACKUP_PATH``backups`Folder on that disk`BACKUP_RETENTION_DAYS``30`Archives older than this are pruned after each run`BACKUP_NOTIFICATION_EMAIL`—Failure email recipient (unset = log only)`BACKUP_DOWNLOAD_EXPIRY``1440`Download-link lifetime in minutes (24h) for `backup:list --url` / `backup()->list()`Folders and database options live in `config/backup.php`:

```
'database' => [
    'connection' => null,           // null = the app's default connection
    'binary_path' => null,          // dir containing mysqldump/pg_dump/sqlite3, null = PATH
],

'files' => [
    'include' => [
        storage_path('app/public'), // absolute folder paths to back up
    ],
    'exclude' => [
        '*.log',                    // glob patterns, matched relative to each folder
        'cache/*',
    ],
],
```

With no folders configured, runs produce a database-only archive — that's the zero-config default.

Usage
-----

[](#usage)

```
php artisan backup:run               # database + files
php artisan backup:run --only-db     # database only
php artisan backup:run --only-files  # files only
```

Schedule it in `routes/console.php`:

```
Schedule::command('backup:run')->daily();
```

Or run it programmatically — returns the uploaded archive filename, throws on failure:

```
$filename = backup()->run();                  // full backup
$filename = backup()->run(database: false);   // files only
```

List the archives already on the disk — each with a temporary download URL when the disk driver supports it (e.g. S3; local disks list with a `null` URL):

```
php artisan backup:list          # Date / Filename / Size table
php artisan backup:list --url    # also print a temporary download URL column
```

Or programmatically — returns a `Collection` of `['filename', 'path', 'size', 'date', 'url']`, newest first:

```
backup()->list();      // download URLs use the configured expiry (default 24h)
backup()->list(60);    // override: URLs valid for 60 minutes
```

Exit codes: `0` success · `1` backup failed (already logged/emailed) · `2` invalid flag combination.

Failure notifications
---------------------

[](#failure-notifications)

When a run fails for any reason — dump error, missing folder, upload rejected — the error is logged and a markdown email is sent to `BACKUP_NOTIFICATION_EMAIL` (if set), then the exception is rethrown. A broken mailer never masks the original failure.

Development
-----------

[](#development)

This is a package, so there is no `artisan` — [Orchestra Testbench](https://github.com/orchestral/testbench) is the artisan:

```
composer install
composer test                              # Pest 4 + Testbench suite
composer lint                              # Pint
vendor/bin/testbench backup:run --only-db  # run the command in the throwaway app
```

End-to-end dump tests require the `sqlite3` binary and skip cleanly when it's absent. See `CLAUDE.md` for the package conventions and `docs/superpowers/specs/` for the design doc.

License
-------

[](#license)

MIT.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

51d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/101174228?v=4)[Jiannius Technologies Sdn. Bhd.](/maintainers/jiannius)[@jiannius](https://github.com/jiannius)

---

Top Contributors

[![tjloong](https://avatars.githubusercontent.com/u/2275921?v=4)](https://github.com/tjloong "tjloong (7 commits)")

---

Tags

laravelpackagebackup

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/jiannius-backup/health.svg)

```
[![Health](https://phpackages.com/badges/jiannius-backup/health.svg)](https://phpackages.com/packages/jiannius-backup)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M86](/packages/unisharp-laravel-filemanager)[illuminate/filesystem

The Illuminate Filesystem package.

15265.2M3.3k](/packages/illuminate-filesystem)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[zanysoft/laravel-zip

laravel-zip is the world's leading zip utility for file compression and backup.

3203.0M15](/packages/zanysoft-laravel-zip)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
