Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Backup Server Laravel Package

spatie/laravel-backup-server

Receive, store, and manage encrypted backups from multiple Laravel apps on a dedicated backup server. Built on top of spatie/laravel-backup, it centralizes backup uploads, retention, and monitoring for safer off-site storage.

View on GitHub
Deep Wiki
Context7

title: The backup process weight: 3

When creating a backup, these steps will be performed.

1. Ensuring that the source is reachable

The package will try to log in the source server and perform the whoami command. If that succeeds, the source is considered reachable. If that fails, the backup process will stop.

2. Ensuring that the destination is reachable

The package will verify if the disk_name on the Destination matches a disk defined in config/filesystems.php. If the disk does not exist, the backup process will stop.

3. Determining the destination directory

On the destination disk a directory will be created with this format:

/<source-id>/<backup-<date-in-YmdHis-format>

If that directory could not be created - you know the drill by now - the backup process will stop.

4. Perform pre-backup commands

On a Source you can save an array with unix commands pre_backup_commands. These commands will now be executed on the source. You could add a command here to dump your database to the filesystem, so it will be backed up too.

If one of these commands fail, the backup process will stop.

5. Running the actual backup.

Finally, we have arrived to the holy grail of this package: taking an actual backup. Under the hood, rsync is used to copy all files and directories specified in the includes array on the Source. Files and directories in the excludes array of the Source will be excluded.

If the backup isn't the initial one, than rsync will take in account the previous backup. Only files that are new or changed will be copied to the destination directory of the backup. Files that are identical to the ones in the previous backup, will not be copied. Instead, rsync will put a hard link to the file in the previous backup. This means that, even though a file will appear in your filesystem, no real disk space will be used.

When the previous backup will be deleted, the hard links will still work. The filesystem is smart enough to know that there is still an entry in the filesystem pointing to the space on the hard disk and the space will not be freed.

Should rsync fail, the backup process will stop

6. Perform post-backup commands

On a Source you can save an array with unix commands post_backup_commands. These commands will now be executed on the source. You could add a command here to delete and old db dumps from the filesystem.

If one of these commands fail, the backup process will stop.

7. Calculate backup size

The total size of the backup will now be calculated and save in the size_in_kb attribute on the Source. This size in the total if you were to copy all these files to another disk. On your backup disk it could be, due to the use of hard link, that the actually used space on disk is much lower.

You can increase the default timeout for this calculation with the backup_size_calculation_timeout_in_seconds value in the config file. This may be necessary for very large backups that take a long time to calculate the size of.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport