norman-huth / laravel-git-backup
A Laravel package to backup your application on GitHub
Fund package maintenance!
huth.it/coffee
Requires
- php: ^8.0
- ext-zip: ^1.14.0
- illuminate/config: ^9.0|^10.0|^11.0
- illuminate/console: ^9.0|^10.0|^11.0
- illuminate/container: ^9.0|^10.0|^11.0
- illuminate/events: ^9.0|^10.0|^11.0
- illuminate/filesystem: ^9.0|^10.0|^11.0
- league/flysystem: ^3.11
- spatie/db-dumper: ^3.0
This package is auto-updated.
Last update: 2024-12-11 19:51:54 UTC
README
Actually, I didn't want to make it as a (public) package. So I kept everything short and simple in this readme.
This package create a backup via Git.
A few code parts are taken from spatie/laravel-backup. Also, the spatie/db-dumper from spatie is used.
Configuration
In the default configuration, Laravel storage/app
folder uses for backup include a dump of mysql
database connection. In this case, the Backup Git repository is located in the storage/app/.git
directory.
To change the configuration publish the config/git-backup.php file via command line:
php artisan vendor:publish --provider="NormanHuth\LaravelGitBackup\ServiceProvider"
Usage
Run the backup manually
php artisan git:backup:run
Scheduling
For example use Laravel Task Scheduling
$schedule->command('git:backup:run')->dailyAt('4:00');
Notice
Don't forget to configure global Git settings
git config --global user.email "you@example.com" git config --global user.name "Your Name"