From d211bcd5faf70b27181e744ae92f0d3f9816c74c Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 20 Jun 2023 09:52:10 +0200 Subject: [PATCH] Solved type error: https://chat.openai.com/share/132f9bdd-f09c-4ffa-ae80-28c04d5fc484 --- roles/independent_backup-to-usb/files/backup-to-usb.python | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/roles/independent_backup-to-usb/files/backup-to-usb.python b/roles/independent_backup-to-usb/files/backup-to-usb.python index 0ace95ba..41a341d8 100644 --- a/roles/independent_backup-to-usb/files/backup-to-usb.python +++ b/roles/independent_backup-to-usb/files/backup-to-usb.python @@ -40,10 +40,11 @@ def main(): print("Starting synchronization...") try: rsync_command = [ - "rsync", "-abP", "--delete", "--delete-excluded", - "--link-dest=" + previous_version_path, - source_path, current_version_path + "rsync", "-abP", "--delete", "--delete-excluded" ] + if previous_version_path is not None: + rsync_command.append("--link-dest=" + previous_version_path) + rsync_command.extend([source_path, current_version_path]) rsync_output = subprocess.check_output(rsync_command, stderr=subprocess.STDOUT, text=True) print(rsync_output)