wertmenschen / backup by Sebzap

Backup of Laravel applications to WebDAV (Nextcloud/Owncloud)
1,795
0
1
Package Data
Maintainer Username: Sebzap
Maintainer Contact: packages@wertmenschen.de (Sebastian Schöps)
Package Create Date: 2017-07-10
Package Last Update: 2019-03-27
Language: PHP
License: MIT
Last Refreshed: 2024-11-23 03:04:16
Package Statistics
Total Downloads: 1,795
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Wertmenschen Backup

Require this package with composer

composer require wertmenschen/backup

Create a webdav filesystem

// config/filesystems.php

'disks' => [
    'webdav' => [
        'driver'   => 'webdav',
        'baseUri'  => env('BACKUP_URL'),
        'userName' => env('BACKUP_USERNAME'),
        'password' => env('BACKUP_PASSWORD'),
    ],
];

Optional: Publish the backup config file (overrides Spatie config)

php artisan vendor:publish --provider="Wertmenschen\Backup\BackupServiceProvider"

Set keys in .env

  • BACKUP_URL
  • BACKUP_USERNAME
  • BACKUP_PASSWORD
  • BACKUP_SLACK_WEBHOOK

Schedule backups

Spatie documentation: https://docs.spatie.be/laravel-backup/v4

// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
   $schedule->command('backup:clean')->daily()->at('01:00');
   $schedule->command('backup:run')->daily()->at('02:00');
   $schedule->command('backup:run --only-db')->hourly();
   
   $schedule->command('backup:clean')->dailyAt(4);
   $schedule->command('backup:monitor')->dailyAt(5);
}