Add date to db backups

This commit is contained in:
Tim 2022-06-20 18:12:51 +02:00
parent 921da75891
commit 3b7c037d83

View File

@ -15,7 +15,8 @@ class BackupService
public function backup(string $db, ?string $fileName = null): string public function backup(string $db, ?string $fileName = null): string
{ {
if (!$fileName) { 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(); $filesystem = new Filesystem();