Dataclass
BackupHostPath ¶
Bases: PurePosixPath
Represents a path for a Connection.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
segments
|
str | PathLike[str]
|
segments of the path |
()
|
connection
|
Connection
|
The connection used for this path. |
required |
Source code in b4_backup/main/dataclass.py
exists ¶
Returns:
Type | Description |
---|---|
bool
|
True if the location exists. |
Source code in b4_backup/main/dataclass.py
is_dir ¶
iterdir ¶
Returns:
Type | Description |
---|---|
list[BackupHostPath]
|
A list of Paths containing all items in the current directory. |
Source code in b4_backup/main/dataclass.py
mkdir ¶
Creates a directory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parents
|
bool
|
Also creates parent directories and doesn't fail if path exist. |
False
|
rename ¶
Renames/Moves the path to the target location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target
|
PurePath
|
The target location to move the object to. |
required |
rmdir ¶
Removes the given empty directory.
ChoiceSelector
dataclass
¶
Describes a set of data, with dynamic choices.
Attributes:
Name | Type | Description |
---|---|---|
data |
list[str]
|
Contains the actual data |
resolve_retention_name ¶
Resolves a retention_name selector and returns a list based on the selection.
Returns:
Type | Description |
---|---|
list[str]
|
List of resolved items |
Source code in b4_backup/main/dataclass.py
resolve_target ¶
Resolves a target selector and returns a list based on the selection.
Returns:
Type | Description |
---|---|
list[str]
|
List of resolved items |
Source code in b4_backup/main/dataclass.py
RetentionGroup
dataclass
¶
Contains the retention ruleset for a target.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the retention ruleset |
target_retention |
dict[str, str]
|
The retention ruleset for the target itself |
is_source |
bool
|
True if this is a source retention ruleset |
obsolete_snapshots |
set[str]
|
All snapshots in this set will be condidered obsolete |
from_target
classmethod
¶
Create an instance from a target and ruleset name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
retention_name
|
str
|
Name of the retention ruleset to select from the target |
required |
target
|
BackupTarget
|
Target to get the ruleset from |
required |
is_source
|
bool
|
Select source ruleset or destination ruleset |
True
|
obsolete_snapshots
|
set[str] | None
|
All snapshots in this set will be condidered obsolete |
None
|
Returns:
Type | Description |
---|---|
RetentionGroup
|
RetentionGroup instance |
Source code in b4_backup/main/dataclass.py
Snapshot
dataclass
¶
Describes a b4_snapshot.
subvolumes_unescaped
property
¶
Returns:
Type | Description |
---|---|
None
|
List all subvolumes without delimiter translation as relative paths. |
escape_path
classmethod
¶
Returns:
Type | Description |
---|---|
BackupHostPath
|
Escaped variant of subvolume path. |
Source code in b4_backup/main/dataclass.py
from_new
classmethod
¶
Create instance from the backup target location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the snapshot |
required |
subvolumes
|
list[BackupHostPath]
|
List of subvolumes without delimiter translation |
required |
base_path
|
BackupHostPath
|
Location of this snapshot |
required |
Source code in b4_backup/main/dataclass.py
unescape_path
classmethod
¶
Returns:
Type | Description |
---|---|
BackupHostPath
|
Recreates a path from an escaped variant of subvolume path. |