From ae2a1b8135084bba526d1db041feba843424a4c3 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Sat, 15 Jul 2017 16:23:08 +0200 Subject: [PATCH] Name backup directories with 'before-upgrade' Closes gh-2811 --- docs/usage/upgrade.rst | 2 +- docs/usage/upgrade.rst.inc | 4 ++-- src/borg/archiver.py | 2 +- src/borg/upgrader.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/usage/upgrade.rst b/docs/usage/upgrade.rst index f45da8ba8..044c81cf6 100644 --- a/docs/usage/upgrade.rst +++ b/docs/usage/upgrade.rst @@ -6,7 +6,7 @@ Examples # Upgrade the borg repository to the most recent version. $ borg upgrade -v /path/to/repo - making a hardlink copy in /path/to/repo.upgrade-2016-02-15-20:51:55 + making a hardlink copy in /path/to/repo.before-upgrade-2016-02-15-20:51:55 opening attic repository with borg and converting no key file found for repository converting repo index /path/to/repo/index.0 diff --git a/docs/usage/upgrade.rst.inc b/docs/usage/upgrade.rst.inc index 224262996..980d9de28 100644 --- a/docs/usage/upgrade.rst.inc +++ b/docs/usage/upgrade.rst.inc @@ -134,7 +134,7 @@ make sure the cache files are also removed: Unless ``--inplace`` is specified, the upgrade process first creates a backup copy of the repository, in -REPOSITORY.upgrade-DATETIME, using hardlinks. This takes +REPOSITORY.before-upgrade-DATETIME, using hardlinks. This takes longer than in place upgrades, but is much safer and gives progress information (as opposed to ``cp -al``). Once you are satisfied with the conversion, you can safely destroy the @@ -144,4 +144,4 @@ WARNING: Running the upgrade in place will make the current copy unusable with older version, with no way of going back to previous versions. This can PERMANENTLY DAMAGE YOUR REPOSITORY! Attic CAN NOT READ BORG REPOSITORIES, as the -magic strings have changed. You have been warned. \ No newline at end of file +magic strings have changed. You have been warned. diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 607cee0d4..f98f0297d 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -3391,7 +3391,7 @@ class Archiver: Unless ``--inplace`` is specified, the upgrade process first creates a backup copy of the repository, in - REPOSITORY.upgrade-DATETIME, using hardlinks. This takes + REPOSITORY.before-upgrade-DATETIME, using hardlinks. This takes longer than in place upgrades, but is much safer and gives progress information (as opposed to ``cp -al``). Once you are satisfied with the conversion, you can safely destroy the diff --git a/src/borg/upgrader.py b/src/borg/upgrader.py index be5c34a7f..0b92ce8e2 100644 --- a/src/borg/upgrader.py +++ b/src/borg/upgrader.py @@ -35,7 +35,7 @@ class AtticRepositoryUpgrader(Repository): with self: backup = None if not inplace: - backup = '{}.upgrade-{:%Y-%m-%d-%H:%M:%S}'.format(self.path, datetime.datetime.now()) + backup = '{}.before-upgrade-{:%Y-%m-%d-%H:%M:%S}'.format(self.path, datetime.datetime.now()) logger.info('making a hardlink copy in %s', backup) if not dryrun: shutil.copytree(self.path, backup, copy_function=os.link)