#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import annotations from sys import exit import config from zfs_backup.misc import verify_running_as_root from zfs_backup import Manager, Pool, ExternalPool EXIT_ERROR = 1 def main(): verify_running_as_root() local_pool = Pool(config.local_pool_to_backup) external_pool = ExternalPool.find_from_dict(config.backup_pools) manager = Manager(local_pool, external_pool) manager.backup() # TODO tests # TODO --skip-import # TODO skip post-backup scrub if nothing was sent (except when pre-scrub was also skipped) # TODO print time estimation while scrub is in progress # TODO logging if __name__ == "__main__": try: main() except KeyboardInterrupt: exit(EXIT_ERROR) except Exception as e: print(e) exit(EXIT_ERROR)