Skip to content

Commit 7cd2428

Browse files
committed
upload and listing
1 parent 6a1ffd3 commit 7cd2428

40 files changed

+1601
-771
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ The `--quick` option will only create an incremental backup
4343
**Browse your restoring points**
4444

4545
./occ backup:point:browse
46+
47+
48+
49+
### Known issues:
50+
51+
- cannot upload restoring point with file bigger than 100M
52+
- uploading a parent RP after a dependant incremental backup does not remote the 'orphan' tag
53+

appinfo/info.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
<command>OCA\Backup\Command\RemoteList</command>
2727
<command>OCA\Backup\Command\RemoteRemove</command>
2828

29-
<command>OCA\Backup\Command\PointBrowse</command>
29+
<command>OCA\Backup\Command\PointList</command>
3030
<command>OCA\Backup\Command\PointCreate</command>
3131
<command>OCA\Backup\Command\PointUpload</command>
32+
<command>OCA\Backup\Command\PointDownload</command>
3233

3334
<command>OCA\Backup\Command\SetupExport</command>
3435
<command>OCA\Backup\Command\SetupImport</command>

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/AppInfo/Application.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,12 @@
3333

3434

3535
use OCA\Backup\Handlers\WebfingerHandler;
36-
use OCA\Backup\Listeners\FileChanged;
37-
use OCA\Backup\Listeners\FileCreated;
38-
use OCA\Backup\Listeners\FileDeleted;
39-
use OCA\Backup\Listeners\FileRenamed;
36+
use OCA\Backup\Listeners\NodeEvent;
4037
use OCP\AppFramework\App;
4138
use OCP\AppFramework\Bootstrap\IBootContext;
4239
use OCP\AppFramework\Bootstrap\IBootstrap;
4340
use OCP\AppFramework\Bootstrap\IRegistrationContext;
4441
use OCP\Files\Events\Node\NodeCreatedEvent;
45-
use OCP\Files\Events\Node\NodeDeletedEvent;
4642
use OCP\Files\Events\Node\NodeRenamedEvent;
4743
use OCP\Files\Events\Node\NodeWrittenEvent;
4844

@@ -78,10 +74,9 @@ public function __construct(array $params = []) {
7874
* @param IRegistrationContext $context
7975
*/
8076
public function register(IRegistrationContext $context): void {
81-
$context->registerEventListener(NodeCreatedEvent::class, FileCreated::class);
82-
$context->registerEventListener(NodeWrittenEvent::class, FileChanged::class);
83-
$context->registerEventListener(NodeRenamedEvent::class, FileRenamed::class);
84-
$context->registerEventListener(NodeDeletedEvent::class, FileDeleted::class);
77+
$context->registerEventListener(NodeCreatedEvent::class, NodeEvent::class);
78+
$context->registerEventListener(NodeWrittenEvent::class, NodeEvent::class);
79+
$context->registerEventListener(NodeRenamedEvent::class, NodeEvent::class);
8580

8681
$context->registerWellKnownHandler(WebfingerHandler::class);
8782
}

lib/Command/PointBrowse.php

Lines changed: 0 additions & 161 deletions
This file was deleted.

lib/Command/PointCreate.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@
3737
use OCA\Backup\Exceptions\ArchiveNotFoundException;
3838
use OCA\Backup\Exceptions\BackupAppCopyException;
3939
use OCA\Backup\Exceptions\BackupScriptNotFoundException;
40+
use OCA\Backup\Exceptions\RestoringPointException;
4041
use OCA\Backup\Exceptions\SqlDumpException;
4142
use OCA\Backup\Service\PointService;
4243
use OCP\Files\NotFoundException;
4344
use OCP\Files\NotPermittedException;
4445
use Symfony\Component\Console\Input\InputInterface;
46+
use Symfony\Component\Console\Input\InputOption;
4547
use Symfony\Component\Console\Output\OutputInterface;
4648

4749

@@ -76,7 +78,8 @@ protected function configure() {
7678
parent::configure();
7779

7880
$this->setName('backup:point:create')
79-
->setDescription('Generate a restoring point of the instance');
81+
->setDescription('Generate a restoring point of the instance (complete or incremental)')
82+
->addOption('incremental', '', InputOption::VALUE_NONE, 'create an incremental restoring point');
8083
}
8184

8285

@@ -92,9 +95,10 @@ protected function configure() {
9295
* @throws BackupAppCopyException
9396
* @throws BackupScriptNotFoundException
9497
* @throws SqlDumpException
98+
* @throws RestoringPointException
9599
*/
96100
protected function execute(InputInterface $input, OutputInterface $output): int {
97-
$point = $this->pointService->create(true);
101+
$point = $this->pointService->create(!$input->getOption('incremental'));
98102

99103
if ($input->getOption('output') === 'none') {
100104
return 0;

0 commit comments

Comments
 (0)