Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit aaa16ed

Browse files
authored
fix: Escape spacing on backup schedule refers # 229
1 parent 026b04d commit aaa16ed

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/AppBundle/Entity/BackupSchedule.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,15 @@ public function getShellCommands()
363363
$commandTexts = '#!/bin/sh
364364
365365
';
366+
367+
$backupName = str_replace(" ", "", $this->name);
366368

367369

368370
foreach ($this->containers as $container) {
369371
$commandTexts = $commandTexts . '
370372
# Backup for Container ' . $container->getName() . ' to ' . $this->destination->getName() . '
371373
372-
DIRECTORY=/tmp/' . $this->name . '/
374+
DIRECTORY=/tmp/' . $backupName . '/
373375
CONTAINER=' . $container->getName() . '
374376
375377
# Just generating a random number
@@ -404,11 +406,11 @@ public function getShellCommands()
404406
if ($this->type == "incremental") {
405407
$commandTexts = $commandTexts .
406408
'# Backup via duplicity
407-
duplicity --no-encryption /tmp/' . $this->name . ' ' . $this->destination->getDestinationText($this->name);
409+
duplicity --no-encryption /tmp/' . $backupName . ' ' . $this->destination->getDestinationText($this->name);
408410
} else {
409411
$commandTexts = $commandTexts .
410412
'# Backup via duplicity
411-
duplicity ' . $this->type . ' --no-encryption /tmp/' . $this->name . ' ' . $this->destination->getDestinationText($this->name);
413+
duplicity ' . $this->type . ' --no-encryption /tmp/' . $backupName . ' ' . $this->destination->getDestinationText($this->name);
412414
}
413415

414416
$commandTexts = $commandTexts .

0 commit comments

Comments
 (0)