added SnapshotManager, added simple function to list snapshots

This commit is contained in:
Jonathan Treffler 2023-06-08 18:23:09 +02:00 committed by root
parent dd565a988e
commit 4c67bf71c4
3 changed files with 18 additions and 2 deletions

View file

@ -0,0 +1,16 @@
<?php
namespace OCA\GroupfolderFilesystemSnapshots\Manager;
class SnapshotManager {
function get() {
$filesystem_path = "/srv/nextcloud/files/";
$filesystem_snapshot_path = "/srv/nextcloud/files/.zfs/snapshot/";
$iterator = new \FilesystemIterator($filesystem_snapshot_path);
foreach ($iterator as $fileinfo) {
if(!$fileinfo->isDir()) continue;
yield $fileinfo->getFilename();
}
}
}