Backups to SMB no longer crawl; add occ backup:cancel

Each 30-second step opened the location again and read its list of
index files. Over SMB that cost a request per file, so on a large
repository opening took longer than the step: each step stored one
4 MiB pack and the list grew further. A first backup of nc01 to a
Storage Box over SMB managed 12 GiB in 35 hours.

occ backup:run and system cron now keep the repository open for the
whole run (reopened when another process took a step or the location
was edited), opening no longer counts towards the step's time, and
SMB folders are listed in one request.

occ backup:cancel stops a running backup: no new step starts and the
step in progress finishes first. A run of an earlier version, which
does not hold back its next step, is marked cancelled after two
minutes unless it is recording its snapshot.
This commit is contained in:
2026-10-14 12:15:27 +02:00
parent 92e693cfe6
commit dfd3f38d8c
9 changed files with 336 additions and 10 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
// Stand-in for the files_external SMB storage in unit tests: only what StorageBackend uses.
namespace OCA\Files_External\Lib\Storage;
use OCP\Files\Storage\IStorage;
if (!class_exists(SMB::class)) {
abstract class SMB implements IStorage {
/** @var object */
protected $share;
protected bool $showHidden = false;
protected bool $checkAcl = false;
protected function buildPath(string $path): string {
return '/' . trim($path, '/');
}
}
}