-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
152 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -15,4 +15,4 @@ | |
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
__version__ = "1.9.21" | ||
__version__ = "1.9.22" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/python3 | ||
""" | ||
Copyright (C) 2022 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -107,12 +107,6 @@ def configLogger( | |
) | ||
|
||
|
||
def partialBackup(args: Namespace) -> int: | ||
"""Check for possible partial backup files""" | ||
partialFiles = glob.glob(f"{args.output}/*.partial") | ||
return len(partialFiles) > 0 | ||
|
||
|
||
def hasFullBackup(args: Namespace) -> int: | ||
"""Check if full backup file exists in target directory""" | ||
fullFiles = glob.glob(f"{args.output}/*.full.data") | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/python3 | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
""" | ||
|
||
import os | ||
import glob | ||
import logging | ||
from argparse import Namespace | ||
|
||
from libvirtnbdbackup import exceptions | ||
|
||
|
||
log = logging.getLogger() | ||
|
||
|
||
def _exists(args: Namespace) -> int: | ||
"""Check for possible partial backup files""" | ||
partialFiles = glob.glob(f"{args.output}/*.partial") | ||
return len(partialFiles) > 0 | ||
|
||
|
||
def exists(args: Namespace) -> bool: | ||
"""Check if target directory has an partial backup, | ||
makes backup utility exit errnous in case backup | ||
type is full or inc""" | ||
if args.level in ("inc", "diff") and args.stdout is False and _exists(args) is True: | ||
log.error("Partial backup found in target directory: [%s]", args.output) | ||
log.error("One of the last backups seems to have failed.") | ||
log.error("Consider re-executing full backup.") | ||
return True | ||
|
||
return False | ||
|
||
|
||
def rename(targetFilePartial: str, targetFile: str) -> None: | ||
"""After backup, move .partial file to real | ||
target file""" | ||
try: | ||
os.rename(targetFilePartial, targetFile) | ||
except OSError as e: | ||
raise exceptions.DiskBackupFailed(f"Failed to rename file: [{e}]") from e |
2 changes: 1 addition & 1 deletion
2
libvirtnbdbackup/common/processinfo.py → libvirtnbdbackup/processinfo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2022 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -23,7 +23,7 @@ | |
from argparse import Namespace | ||
|
||
from libvirtnbdbackup.ssh.exceptions import sshError | ||
from libvirtnbdbackup.common.processinfo import processInfo | ||
from libvirtnbdbackup.processinfo import processInfo | ||
from libvirtnbdbackup.qemu import command | ||
from libvirtnbdbackup.virt.client import DomainDisk | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2020 Red Hat, Inc. | ||
This program is free software: you can redistribute it and/or modify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2020 Red Hat, Inc. | ||
This program is free software: you can redistribute it and/or modify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2022 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -26,7 +26,7 @@ | |
) | ||
|
||
from libvirtnbdbackup.ssh import exceptions | ||
from libvirtnbdbackup.common.processinfo import processInfo | ||
from libvirtnbdbackup.processinfo import processInfo | ||
|
||
log = logging.getLogger("ssh") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
""" | ||
Copyright (C) 2021 Michael Ablassmeier <[email protected]> | ||
Copyright (C) 2023 Michael Ablassmeier <[email protected]> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.