Skip to content

Commit

Permalink
0.0.4 release
Browse files Browse the repository at this point in the history
  • Loading branch information
s-m-e committed Jul 22, 2020
2 parents 1a8d17c + 036d910 commit 9098760
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 32 deletions.
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changes

## 0.0.4 (2020-07-22)

- FEATURE: Improved labels in wizard GUI
- FEATURE: Significantly improved German translation
- FIX: Importing `CLoader` and `CDumper` from `pyyaml` caused crashes if they were not present in `pyyaml` packages, see #2.
- FIX: The `mountpoint` property of ZFS datasets is no longer assumed to be present at all (set or unset). This allows to handle ZVOLs without crashing, see issue #6.
- FIX: Versions 0.0.2 and 0.0.3 were completely ignoring ZVOLs when looking for snapshot tasks, see issue #10.

## 0.0.3 (2020-07-19)

- FEATURE: Added wizard GUI for backup tasks (`snap`, `backup`, `cleanup`)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ ssh:
cipher: [email protected]
```
The prefix can be empty on either side. If a `host` is set to `localhost`, the `user` field can be left empty. Both source and target can be remote hosts or localhost at the same time. `keep_snapshots` is an integer and must be greater or equal to `1`. It specifies the number of snapshots that are kept per dataset on the source side when a cleanup operation is triggered. `suffix` contains the name suffix for new snapshots. Setting `always_changed` to `yes` causes `abgleich` to beliefe that all datasets have always changed since the last snapshot, completely ignoring what ZFS actually reports. No diff will be checked produced for values of `written` lower than `written_threshold`. Checking diffs can be completely deactivated by setting `check_diff` to `no`. `digits` specifies how many digits are used for a decimal number describing the n-th snapshot per dataset per day as part of the name of new snapshots. `ignore` lists stuff underneath the `prefix` which will be ignored by this tool, i.e. no snapshots, backups or cleanups. `ssh` allows to fine-tune the speed of backups. In fast local networks, it is best to set `compression` to `no` because the compression is usually slowing down the transfer. However, for low-bandwidth transmissions, it makes sense to set it to `yes`. For significantly better speed in fast local networks, make sure that both the source and the target system support a common cipher, which is accelerated by [AES-NI](https://en.wikipedia.org/wiki/AES_instruction_set) on both ends.
The prefix can be empty on either side. If a `host` is set to `localhost`, the `user` field can be left empty. Both source and target can be remote hosts or localhost at the same time. `keep_snapshots` is an integer and must be greater or equal to `1`. It specifies the number of snapshots that are kept per dataset on the source side when a cleanup operation is triggered. `suffix` contains the name suffix for new snapshots. Setting `always_changed` to `yes` causes `abgleich` to beliefe that all datasets have always changed since the last snapshot, completely ignoring what ZFS actually reports. No diff will be produced & checked for values of `written` lower than `written_threshold`. Checking diffs can be completely deactivated by setting `check_diff` to `no`. `digits` specifies how many digits are used for a decimal number describing the n-th snapshot per dataset per day as part of the name of new snapshots. `ignore` lists stuff underneath the `prefix` which will be ignored by this tool, i.e. no snapshots, backups or cleanups. `ssh` allows to fine-tune the speed of backups. In fast local networks, it is best to set `compression` to `no` because the compression is usually slowing down the transfer. However, for low-bandwidth transmissions, it makes sense to set it to `yes`. For significantly better speed in fast local networks, make sure that both the source and the target system support a common cipher, which is accelerated by [AES-NI](https://en.wikipedia.org/wiki/AES_instruction_set) on both ends.
## USAGE
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# Package version
__version__ = "0.0.3"
__version__ = "0.0.4"

# List all versions of Python which are supported
python_minor_min = 6
Expand Down
8 changes: 6 additions & 2 deletions src/abgleich/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@

import typeguard
import yaml
from yaml import CLoader

try:
from yaml import CLoader as Loader
except ImportError:
from yaml import FullLoader as Loader

from .abc import ConfigABC
from .lib import valid_name
Expand Down Expand Up @@ -71,7 +75,7 @@ def from_fd(cls, fd: typing.TextIO):
"ssh": lambda v: cls._validate(data=v, schema=ssh_schema),
}

config = yaml.load(fd.read(), Loader=CLoader)
config = yaml.load(fd.read(), Loader=Loader)
cls._validate(data=config, schema=root_schema)
return cls(config)

Expand Down
19 changes: 19 additions & 0 deletions src/abgleich/core/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,25 @@ def __getitem__(self, key: typing.Union[str, int, slice]) -> PropertyABC:
return self._properties[key]
return self._snapshots[key]

def get(
self,
key: typing.Union[str, int, slice],
default: typing.Union[None, PropertyABC] = None,
) -> typing.Union[None, PropertyABC]:

if isinstance(key, str):
return self._properties.get(
key,
Property(key, None, None) if default is None else default,
)

assert isinstance(key, int) or isinstance(key, slice)

try:
return self._snapshots[key]
except IndexError:
return default

@property
def changed(self) -> bool:

Expand Down
15 changes: 12 additions & 3 deletions src/abgleich/core/i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@

import typeguard
import yaml
from yaml import CDumper, CLoader

try:
from yaml import CLoader as Loader
except ImportError:
from yaml import FullLoader as Loader

try:
from yaml import CDumper as Dumper
except ImportError:
from yaml import Dumper

# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# CLASS
Expand Down Expand Up @@ -71,13 +80,13 @@ def _load(self):
self.clear()

with open(self._path, "r") as f:
self.update(yaml.load(f.read(), Loader=CLoader))
self.update(yaml.load(f.read(), Loader=Loader))

def _dump(self):

with open(self._path, "w") as f:
f.write(
yaml.dump(self.copy(), Dumper=CDumper, allow_unicode=True, indent=4)
yaml.dump(self.copy(), Dumper=Dumper, allow_unicode=True, indent=4)
)


Expand Down
2 changes: 1 addition & 1 deletion src/abgleich/core/zpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def _get_snapshot_transactions_from_dataset(

if dataset.subname in self._config["ignore"]:
return
if dataset["mountpoint"].value is None:
if dataset.get("mountpoint").value is None and dataset['type'].value == 'filesystem':
return
if not dataset.changed:
return
Expand Down
91 changes: 67 additions & 24 deletions src/abgleich/share/translations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,116 @@ Cancel:
Close:
de: Schließen
Collect Backup Transactions:
de: Sicherungstransaktionen sammeln
de_SE: Sicherungstransaktionen sammeln
de: Snapshots vergleichen
en: Compare snapshots
Collect Cleanup Transactions:
de: Säuberungstransaktionen sammeln
de_SE: Säuberungstransaktionen sammeln
de: Alte Snapshots ermitteln
en: Detect obsolete snapshots
Collect Snapshot Transactions:
de: Schnappschuss-Transaktionen sammeln
de_SE: Schnappschuss-Transaktionen sammeln
de: Änderungen ermitteln
en: Detect changes
Collecting backup transactions ...:
de: Sicherungstransaktionen sammeln ...
de_SE: Sicherungstransaktionen sammeln ...
de: Snapshots des Quell- und Ziel-Systems vergleichen ...
en: Compare snapshots on source and target sides ...
Collecting cleanup transactions ...:
de: Säuberungstransaktionen sammeln ...
de_SE: Säuberungstransaktionen sammeln ...
de: Nicht mehr erforderliche Snapshots ermitteln ...
en: Detect obsolete snapshots ...
Collecting snapshot transactions ...:
de: Schnappschuss-Transaktionen sammeln ...
de_SE: Schnappschuss-Transaktionen sammeln ...
de: Änderungen im Quell-System ermitteln ...
en: Detect changes on source side ...
Creating snapshots ...:
de: Schnappschüsse erstellen ...
de_SE: Schnappschüsse erstellen ...
de: Snapshots im Quell-System anlegen ...
en: Create snapshots on source side ...
Do you want to continue?:
de: Möchten Sie fortfahren?
Execute Backup Transactions:
de: Sicherungstransaktionen ausführen
de_SE: Sicherungstransaktionen ausführen
de: Snapshots übertragen
en: Transfer snapshots
Execute Cleanup Transactions:
de: Säuberungstransaktionen ausführen
de_SE: Säuberungstransaktionen ausführen
de: Snapshots entfernen
en: Delete snapshots
Execute Snapshot Transactions:
de: Schnappschuss-Transaktionen ausführen
de_SE: Schnappschuss-Transaktionen ausführen
de: Snapshots anlegen
en: Create snapshots
FAILED:
de: FEHLGESCHLAGEN
NAME: {}
OK: {}
Old snapshots removed.:
de: Alte Schnappschüsse entfernt.
de_SE: Alte Schnappschüsse entfernt.
de: Alte Snapshots erfolgreich entfernt!
REFER:
de: VERWEIST
Removing old snapshots ...:
de: Entferne alte Schnappschüsse ...
de_SE: Entferne alte Schnappschüsse ...
de: Entferne alte Snapshots ...
Snapshots created.:
de: Schnappschüsse erstellt.
de_SE: Schnappschüsse erstellt.
de: Snapshots erfolgreich angelegt!
Snapshots transferred.:
de: Schnappschüsse gesichert.
de_SE: Schnappschüsse gesichert.
de: Snapshots erfolgreich übertragen!
Transferring snapshots ...:
de: Sichere Schnappschüsse ...
de_SE: Sichere Schnappschüsse ...
de: Snapshots vom Quell-System auf das Ziel-System übertragen ...
en: Transfer snapshots from source to target side ...
USED:
de: BELEGT
abgleich wizard:
de: Abgleich Assistent
ancestor_name:
de: Vorfahr
de_SE: Vorfahr
de: Vorhergehender Snapshot
en: Name of ancestor
cleanup_snapshot:
de: Säuberung
de_SE: Säuberung
de: Zu löschender Snapshot
en: Obsolete snapshot
compressratio:
de: Kompressionsrate
en: Compression ratio
dataset_subname:
de: Datensatz-Namensfragment
de_SE: Datensatz-Namensfragment
de: Name des Datensatzes
en: Name of dataset
nothing to do:
de: nichts zu tun
snapshot:
de: Schnappschuss
de_SE: Schnappschuss
de: Snapshot
snapshot_name:
de: Schnappschuss-Name
de_SE: Schnappschuss-Name
de: Snapshot-Name
en: Name of snapshot
snapshot_subparent:
de: Datensatz-Namensfragment
de_SE: Datensatz-Namensfragment
de: Name des Datensatzes
en: Name of dataset
source:
de: Quelle
target:
de: Ziel
transaction:
de: Transaktion
de_SE: Transaktion
de: Aktion
transfer_snapshot:
de: Sicherung
de_SE: Sicherung
de: Neuer Datensatz & Snapshot
en: New dataset & snapshot
transfer_snapshot_incremental:
de: Inkrementelle Sicherung
de_SE: Inkrementelle Sicherung
de: Differenz zweier Snapshots
en: Difference between snapshots
type:
de: Typ
written:
Expand Down

0 comments on commit 9098760

Please sign in to comment.