ca003c88ba
On S3, index files and the tree segments read back when a snapshot is written are fetched 16 at a time through the storage's S3 client (IBackend::getRanges(), getMany()). Blobs that follow each other in a pack are read as one range on every location. The snapshot is written in a step of its own and the run shows "commit" meanwhile. On a 1 TB production repository the check went from about 4 hours to 3.5 minutes. backup:status and the web interface list the runs of the last 7 days, running ones and at least the newest 5; --all / "Show older runs" list all. Durations of a day or more show the days.
19 lines
480 B
PHP
19 lines
480 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
// SPDX-FileCopyrightText: 2026 Dillard Blom
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
namespace OCA\NgBackup;
|
|
|
|
final class Format {
|
|
/** "12:10:13", or "1d 12:10:13" from a day on (a long first backup takes days). */
|
|
public static function duration(int $seconds): string {
|
|
$seconds = max(0, $seconds);
|
|
$days = intdiv($seconds, 86400);
|
|
$time = gmdate('H:i:s', $seconds % 86400);
|
|
return $days > 0 ? $days . 'd ' . $time : $time;
|
|
}
|
|
}
|