From 3b7c037d834e3424b0dd3663980f13f0c33ba2c6 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 20 Jun 2022 18:12:51 +0200 Subject: [PATCH] Add date to db backups --- src/Service/BackupService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Service/BackupService.php b/src/Service/BackupService.php index d99006d..44f3ff7 100644 --- a/src/Service/BackupService.php +++ b/src/Service/BackupService.php @@ -15,7 +15,8 @@ class BackupService public function backup(string $db, ?string $fileName = null): string { if (!$fileName) { - $fileName = sprintf('%s_backup.sql', $db); + $date = date('y_m_d_H_i'); + $fileName = sprintf('%s_%s_backup.sql', $db, $date); } $filesystem = new Filesystem();