1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-26 09:47:58 +00:00

Clarify cache/repository README file

This commit is contained in:
Marian Beermann 2016-11-11 21:24:16 +01:00
parent 223f7890fe
commit bd4a0fe23b
No known key found for this signature in database
GPG key ID: 9B8450B91D1362C1
4 changed files with 14 additions and 3 deletions

View file

@ -10,6 +10,7 @@
from .logger import create_logger
logger = create_logger()
from .constants import CACHE_README
from .hashindex import ChunkIndex, ChunkIndexEntry
from .helpers import Location
from .helpers import Error
@ -151,7 +152,7 @@ def create(self):
"""
os.makedirs(self.path)
with open(os.path.join(self.path, 'README'), 'w') as fd:
fd.write('This is a Borg cache')
fd.write(CACHE_README)
config = configparser.ConfigParser(interpolation=None)
config.add_section('cache')
config.set('cache', 'version', '1')

View file

@ -50,3 +50,12 @@
DASHES = '-' * 78
PBKDF2_ITERATIONS = 100000
REPOSITORY_README = """This is a Borg Backup repository.
See https://borgbackup.readthedocs.io/
"""
CACHE_README = """This is a Borg Backup cache.
See https://borgbackup.readthedocs.io/
"""

View file

@ -166,7 +166,7 @@ def create(self, path):
if not os.path.exists(path):
os.mkdir(path)
with open(os.path.join(path, 'README'), 'w') as fd:
fd.write('This is a Borg repository\n')
fd.write(REPOSITORY_README)
os.mkdir(os.path.join(path, 'data'))
config = ConfigParser(interpolation=None)
config.add_section('repository')

View file

@ -6,6 +6,7 @@
import logging
logger = logging.getLogger(__name__)
from .constants import REPOSITORY_README
from .helpers import get_home_dir, get_keys_dir, get_cache_dir
from .helpers import ProgressIndicatorPercent
from .key import KeyfileKey, KeyfileNotFoundError
@ -64,7 +65,7 @@ def borg_readme(self):
readme = os.path.join(self.path, 'README')
os.remove(readme)
with open(readme, 'w') as fd:
fd.write('This is a Borg repository\n')
fd.write(REPOSITORY_README)
@staticmethod
def convert_segments(segments, dryrun=True, inplace=False, progress=False):