nyoncode/laravel-backup-manager

nyoncode/laravel-backup-manager

Powerful and extensible backup manager for Laravel applications: databases, files, encryption, integrity manifests and multi-destination storage.

0
Packagist stažení
0
Verzí
1.1.1
Aktuální verze
Závislosti
php ^8.3 ext-json * ext-openssl * illuminate/bus ^12.0|^13.0 illuminate/console ^12.0|^13.0 illuminate/contracts ^12.0|^13.0 illuminate/database ^12.0|^13.0 illuminate/filesystem ^12.0|^13.0 illuminate/queue ^12.0|^13.0 illuminate/support ^12.0|^13.0 nyoncode/laravel-package-toolkit ^2.1.1 symfony/finder ^7.0 symfony/process ^7.0

Files

A backup can include files and folders from your project alongside — or instead of — your databases. This page covers what gets picked up and how to fine-tune it.

Include roots

List the directories (or individual files) to archive:

1'files' => [
2 'include' => [
3 base_path('app'),
4 base_path('.env'),
5 storage_path('app/public'),
6 ],
7],

Each file is stored in the archive under a files/ prefix that mirrors its absolute path (e.g. files/var/www/app/Models/User.php), so entries from several roots never collide and map back cleanly on restore.

Exclusions

1'files' => [
2 'exclude' => [
3 base_path('vendor'), // path prefix
4 base_path('node_modules'),
5 '*.log', // fnmatch glob
6 storage_path('framework'),
7 ],
8],

A pattern matches when it is a path prefix of a file, or when it matches the path (or its basename) as an fnmatch glob. This lets you exclude whole directories and file types in the same list.

Hidden files

1'files' => ['include_hidden' => true], // include dotfiles like .env

Set to false to skip dotfiles and dot-directories.

1'files' => ['follow_symlinks' => false],
  • false (default) — a symlink is recorded in the manifest as link metadata (its target), without archiving the target's contents. On restore the symlink is recreated. This preserves link semantics without duplicating data.
  • true — links are followed and the target's contents are archived as regular files.

Compression

Compression is applied to the whole archive (not per file):

Algorithm Requires Notes
none fastest, largest
gzip built-in good default
bzip2 ext-bz2 smaller, slower
zstd zstd binary best speed/ratio
1'compression' => ['algorithm' => 'gzip', 'level' => 6],

Compression is streamed, so memory stays flat regardless of archive size.

Archive format & limits

Backups are packaged as a streaming TAR archive with GNU extensions, written by the package itself (not PharData). This means:

  • No 8 GiB per-file limit — large database dumps or media files are supported via GNU base-256 size fields.
  • No 100-byte path limit — long paths use GNU long-name entries.
  • Flat memory — reading and writing are streamed in 1 MiB chunks, so archive and file size do not affect memory usage.

The archives are standard and readable by GNU tar / bsdtar.

Files-only backups

1'profiles' => [
2 'uploads' => [
3 'type' => 'files',
4 'files' => ['include' => [storage_path('app/public')]],
5 'destinations' => ['s3'],
6 ],
7],