Juice-Codes / backups by juice

Backup database and application.
23
0
3
Package Data
Maintainer Username: juice
Package Create Date: 2018-11-28
Package Last Update: 2020-07-27
Language: PHP
License: proprietary
Last Refreshed: 2024-04-18 15:15:27
Package Statistics
Total Downloads: 23
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Juice Backups Package

Backup your application and database data to local filesystem.

Note

This package use spatie/db-dumper to dump database data. For supporting database type, please check here and make sure meets the requirement.

Installation

  1. run composer require command composer require juice/backups

  2. register \Juice\Backups\BackupsServiceProvider::class service provider

  3. copy config file and set it up

    • Laravel - php artisan vendor:publish --provider="Juice\Backups\BackupsServiceProvider"

    • Lumen - cp vendor/juice/backups/config/juice-backups.php config/

      (make sure config directory exist)

  4. run setup command php artisan backup:setup

  5. done

Commands

  • backup:setup - initialize package
  • backup:run - backup application and database
  • backup:cleanup - cleanup outdated backups

Usage

All you need to do is add run and cleanup command to schedule method.

/**
 * Define the application's command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $schedule->command('backup:run')->hourly();
    $schedule->command('backup:cleanup')->dailyAt('01:30');
}

You can find more schedule information here.

Backup Mechanism

  1. hourly backups for the past 24 hours
  2. daily backups for the past month
  3. weekly backups for all previous months