Storage limit per location
CI / unit (8.2) (push) Has been cancelled
CI / unit (8.3) (push) Has been cancelled
CI / unit (8.4) (push) Has been cancelled
CI / integration (mariadb, 32) (push) Has been cancelled
CI / integration (mariadb, 33) (push) Has been cancelled
CI / integration (mariadb, 34) (push) Has been cancelled
CI / integration (mariadb, 35) (push) Has been cancelled
CI / integration (pgsql, 32) (push) Has been cancelled
CI / integration (pgsql, 33) (push) Has been cancelled
CI / integration (pgsql, 34) (push) Has been cancelled
CI / integration (pgsql, 35) (push) Has been cancelled
CI / integration (sqlite, 32) (push) Has been cancelled
CI / integration (sqlite, 33) (push) Has been cancelled
CI / integration (sqlite, 34) (push) Has been cancelled
CI / integration (sqlite, 35) (push) Has been cancelled
CI / unit (8.2) (push) Has been cancelled
CI / unit (8.3) (push) Has been cancelled
CI / unit (8.4) (push) Has been cancelled
CI / integration (mariadb, 32) (push) Has been cancelled
CI / integration (mariadb, 33) (push) Has been cancelled
CI / integration (mariadb, 34) (push) Has been cancelled
CI / integration (mariadb, 35) (push) Has been cancelled
CI / integration (pgsql, 32) (push) Has been cancelled
CI / integration (pgsql, 33) (push) Has been cancelled
CI / integration (pgsql, 34) (push) Has been cancelled
CI / integration (pgsql, 35) (push) Has been cancelled
CI / integration (sqlite, 32) (push) Has been cancelled
CI / integration (sqlite, 33) (push) Has been cancelled
CI / integration (sqlite, 34) (push) Has been cancelled
CI / integration (sqlite, 35) (push) Has been cancelled
S3 has no bucket quota, so NG Backup enforces one: before a pack is uploaded, the stored size plus the pack must stay under the location's limit, otherwise the backup stops with an error (and administrators are notified through the failed run). Repacking during prune is exempt, as it is how space is freed. occ backup:target:limit NAME [SIZE|none]. Also ignore credential files in the repository.
This commit is contained in:
@@ -146,4 +146,16 @@ class RepositoryTest extends TestCase {
|
||||
$this->assertFileDoesNotExist(dirname($target, 2) . '/escaped.txt');
|
||||
$this->assertFileDoesNotExist(dirname($target) . '/escaped.txt');
|
||||
}
|
||||
|
||||
public function testStorageLimitStopsTheBackup(): void {
|
||||
$repo = Repository::init($this->backend, 'pw');
|
||||
$repo->setMaxBytes(6 * 1048576); // less than the test tree
|
||||
try {
|
||||
$repo->backupDirectory($this->src);
|
||||
$this->fail('backup should hit the limit');
|
||||
} catch (\OCA\NgBackup\Repository\QuotaExceededException) {
|
||||
}
|
||||
$this->assertLessThanOrEqual(6 * 1048576, $repo->storedBytes());
|
||||
$this->assertSame([], $repo->listSnapshots(), 'no snapshot from an incomplete backup');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user