added SnapshotManager, added simple function to list snapshots
This commit is contained in:
parent
dd565a988e
commit
4c67bf71c4
3 changed files with 18 additions and 2 deletions
|
@ -12,6 +12,6 @@
|
||||||
<category>files</category>
|
<category>files</category>
|
||||||
<bugs>https://git.verdigado.com/verdigado/nextcloud_groupfolder_filesystem_snapshots/issues</bugs>
|
<bugs>https://git.verdigado.com/verdigado/nextcloud_groupfolder_filesystem_snapshots/issues</bugs>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<nextcloud min-version="25" max-version="25"/>
|
<nextcloud min-version="25" max-version="26"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</info>
|
</info>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace OCA\NotesTutorial\AppInfo;
|
namespace OCA\GroupfolderFilesystemSnapshots\AppInfo;
|
||||||
|
|
||||||
use OCP\AppFramework\App;
|
use OCP\AppFramework\App;
|
||||||
|
|
||||||
|
|
16
lib/Manager/SnapshotManager.php
Normal file
16
lib/Manager/SnapshotManager.php
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue