do {
let urls = [
databaseFolder,
FilesFolder,
FontsFolder
]
let outputURL = BackupCacheURL.appendingPathComponent("(Date().toString(format: .yyyyMMddHHmmss)).tar")
let archivePath = try Path(outputURL.path)
let archivePathOutStream = try OutStream(path: archivePath)
let encoder = try Encoder(stream: archivePathOutStream, fileType: .tar, method: .LZMA2, delegate: self)
for url in urls {
try encoder.add(path: Path(url.path), mode: .default)
}
if try encoder.open() {
_ = try encoder.compress()
}
} catch {
print(error.localizedDescription)
}