mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed relative file hierarchy for backups
This commit is contained in:
parent
be79dc1888
commit
398b737781
@ -3,6 +3,7 @@ from datetime import datetime
|
||||
import glob
|
||||
import os
|
||||
from ...globalconf import datadir
|
||||
from pathlib import PurePath
|
||||
|
||||
|
||||
user_files = {
|
||||
@ -32,4 +33,6 @@ def backup(folder,level="full"):
|
||||
assert not os.path.exists(archivefile)
|
||||
with tarfile.open(name=archivefile,mode="x:gz") as archive:
|
||||
for f in real_files:
|
||||
archive.add(f)
|
||||
p = PurePath(f)
|
||||
r = p.relative_to(datadir())
|
||||
archive.add(f,arcname=r)
|
||||
|
Loading…
Reference in New Issue
Block a user