mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Optimized local backup code
This commit is contained in:
@@ -46,15 +46,17 @@ def main():
|
||||
]
|
||||
rsync_output = subprocess.check_output(rsync_command, stderr=subprocess.STDOUT, text=True)
|
||||
|
||||
if "rsync warning: some files vanished before they could be transferred" in rsync_output:
|
||||
print(rsync_output)
|
||||
print("Synchronization finished")
|
||||
sys.exit(0)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.output)
|
||||
if "rsync warning: some files vanished before they could be transferred" in e.output:
|
||||
print("Synchronization finished with rsync warning")
|
||||
sys.exit(0)
|
||||
else:
|
||||
print("Synchronization finished")
|
||||
sys.exit(0)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print("Synchronization failed:", e.output)
|
||||
sys.exit(1)
|
||||
print("Synchronization failed")
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Reference in New Issue
Block a user