salvatorecervone / backup-project
This is my package backup-project
Fund package maintenance!
salvatorecervone
Requires
- php: ^8.3
- illuminate/contracts: ^10.0||^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
With this package you would backup folder of more of yours projects.
Config file
This is a config file
'listpathbackup' => [
[
/** The name of the backup project. */
'name' => env('BACKUP_PROJECT_NAME', 'Backup Project'),
/** The sorce path of the backup. */
'sorce_path' => '/your/path/to/source', // Substitute with the actual source directory
/** The path where the backup files will be stored. */
'backup_path' => env('BACKUP_PROJECT_PATH', storage_path('app/backup')),
/** The path where the backup logs will be stored. */
'log_path' => env('BACKUP_PROJECT_LOG_PATH', storage_path('logs/backup_project.log')),
/** The maximum number of backup files to keep. */
'max_backups' => env('BACKUP_PROJECT_MAX_BACKUPS', 5),
/** The maximum size of each backup file in megabytes. */
'max_size' => env('BACKUP_PROJECT_MAX_SIZE', 100),
/** The backup frequency (in minutes). */
'backup_frequency' => env('BACKUP_PROJECT_FREQUENCY', 60),
/** The backup retention period (in days). */
'backup_retention' => env('BACKUP_PROJECT_RETENTION', 30),
/** The backup compression method. */
'compression' => env('BACKUP_PROJECT_COMPRESSION', 'zip'),
/** The backup encryption method. */
'encryption' => env('BACKUP_PROJECT_ENCRYPTION', false),
/** The encryption key. */
'encryption_key' => env('BACKUP_PROJECT_ENCRYPTION_KEY', 'your-encryption-key'),
/** The encryption cipher. */
'encryption_cipher' => env('BACKUP_PROJECT_ENCRYPTION_CIPHER', 'AES-256-CBC'),
/** The backup notification email address. */
'notification_email' => env('BACKUP_PROJECT_NOTIFICATION_EMAIL', 'your-mail@gmail.com'),
]
]
You can insert multi projects sorces with multi destinations and multi parameters for all projects.
For install:
composer require salvatorecervone/backup-project
For publish config
php artisan vendor:publish --tag="backup-project-config"
For test use
php artisan tink
after
BackupProject::backup()
Artisan command
You find a command artisan for lunch backup for CLI or insert in schedulate
php artisan backup-project:backup
Schedule
If you schedule this, for example, every day you can use default laravel schedulate
App\Console\Kernel.php
protected function schedule(Schedule $schedule) {
$schedule->command('backup-project:backup')->dailyAt('3:00')
}
Credits
License
The MIT License (MIT). Please see License File for more information.