Skip to content

Commit f37b7fa

Browse files
committed
settings to remove nextcloud.log from backup
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 63173bc commit f37b7fa

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/Service/ConfigService.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class ConfigService {
6262
public const PACK_BACKUP = 'pack_backup';
6363
public const BACKUP_DAYS = 'backup_days';
6464

65+
public const INCLUDE_LOGS = 'include_logs';
6566
public const PACK_ENCRYPT = 'pack_encrypt';
6667
public const PACK_COMPRESS = 'pack_compress';
6768
public const PACK_INDEX = 'pack_index';
@@ -99,6 +100,7 @@ class ConfigService {
99100
self::MOCKUP_DATE => 0,
100101
self::BACKUP_DAYS => 60,
101102

103+
self::INCLUDE_LOGS => '1',
102104
self::PACK_ENCRYPT => '1',
103105
self::PACK_COMPRESS => '1',
104106
self::PACK_INDEX => '1',

lib/Service/FilesService.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ public function __construct(
101101
*/
102102
public function fillRestoringData(RestoringData $data, string $path): void {
103103
if (!is_dir($data->getAbsolutePath() . rtrim($path, '/'))) {
104+
if ($data->getType() === RestoringData::ROOT_DATA
105+
&& !$this->configService->getAppValueBool(ConfigService::INCLUDE_LOGS)
106+
&& $path === 'nextcloud.log') {
107+
return;
108+
}
109+
104110
$data->addFile($path);
105111

106112
return;

0 commit comments

Comments
 (0)