refactor: send_datasets_to_backup_pool
This commit is contained in:
+6
-2
@@ -203,6 +203,12 @@ def main():
|
|||||||
backup_pool = find_backup_pool()
|
backup_pool = find_backup_pool()
|
||||||
import_pool(backup_pool)
|
import_pool(backup_pool)
|
||||||
try:
|
try:
|
||||||
|
send_datasets_to_backup_pool(backup_pool, datasets)
|
||||||
|
finally:
|
||||||
|
export_pool(backup_pool)
|
||||||
|
|
||||||
|
|
||||||
|
def send_datasets_to_backup_pool(backup_pool, datasets):
|
||||||
last_local_snapshot = last_snapshot(config.local_pool)
|
last_local_snapshot = last_snapshot(config.local_pool)
|
||||||
if not last_local_snapshot:
|
if not last_local_snapshot:
|
||||||
print("Es scheint keine Snapshots im Speicherpool zu geben")
|
print("Es scheint keine Snapshots im Speicherpool zu geben")
|
||||||
@@ -226,8 +232,6 @@ def main():
|
|||||||
for dataset in datasets:
|
for dataset in datasets:
|
||||||
do_backup(dataset, last_local_snapshot, last_remote_snapshot, backup_pool)
|
do_backup(dataset, last_local_snapshot, last_remote_snapshot, backup_pool)
|
||||||
clean_old_snapshots(dataset, backup_pool)
|
clean_old_snapshots(dataset, backup_pool)
|
||||||
finally:
|
|
||||||
export_pool(backup_pool)
|
|
||||||
|
|
||||||
|
|
||||||
def verify_running_as_root():
|
def verify_running_as_root():
|
||||||
|
|||||||
Reference in New Issue
Block a user