@extends('layouts.user_type.auth') @section('backupLog')
backup:log call to your crontab backup script (see “How to connect” below).
@endif
Every database backup run reported by the crontab script.
| # | Backup | Status | File | Size | Duration | Server | Finished |
|---|---|---|---|---|---|---|---|
| {{ str_pad($logs->firstItem() + $i, 2, '0', STR_PAD_LEFT) }} |
{{ $log->backup_name }}
{{ $log->database_name ?: 'Database' }} · {{ ucfirst($log->source) }}
|
{{ ucfirst($log->status) }} |
{{ $log->file_name ?: '—' }}
@if($log->status === 'failed' && $log->message)
{{ $log->message }}
@elseif($log->storage_path)
{{ $log->storage_path }}
@endif
|
{{ $log->size_for_humans }} | {{ $log->duration_seconds !== null ? gmdate($log->duration_seconds >= 3600 ? 'H:i:s' : 'i:s', (int) $log->duration_seconds) : '—' }} | {{ $log->host ?: '—' }} |
{{ $log->ran_at->format('d-m-Y') }} {{ $log->ran_at->format('H:i:s') }} |
No backups recorded yet | |||||||
Add one line after the dump/upload in the backup script on Google Cloud.
Same server as this app — run the artisan command:
php {{ base_path('artisan') }} backup:log success --name=mysql-daily --database=all \
--file="$FILE" --size="$(stat -c%s "$LOCAL_FILE")" --path="gs://YOUR_BUCKET/$FILE" --duration="$SECONDS"
# on failure (e.g. in the script's error trap)
php {{ base_path('artisan') }} backup:log failed --name=mysql-daily --message="mysqldump failed"
Different server — call the API (set BACKUP_LOG_TOKEN in .env first):
curl -fsS -X POST {{ url('/api/backup-log') }} \
-H "X-Backup-Token: $BACKUP_LOG_TOKEN" -H "Accept: application/json" \
-d status=success -d backup_name=mysql-daily -d file_name="$FILE" \
-d file_size="$(stat -c%s "$LOCAL_FILE")" -d storage_path="gs://YOUR_BUCKET/$FILE"