From 3417bd248df6fdf65740f9d77962f6b17503ee59 Mon Sep 17 00:00:00 2001 From: hubobel Date: Tue, 16 Jun 2026 17:14:40 +0200 Subject: [PATCH] Nextcloud sync --- categorize_transactions.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/categorize_transactions.py b/categorize_transactions.py index 8ad1ca9..bded8a1 100644 --- a/categorize_transactions.py +++ b/categorize_transactions.py @@ -375,7 +375,7 @@ if which("rclone"): "rclone", "copy", str(excel_file), - "nextcloud:Finanzen" + f"nextcloud:Bank/{year}" ], check=True ) @@ -390,17 +390,30 @@ elif platform.system() == "Windows": try: - target = ( + target_dir = ( Path.home() / "Nextcloud" - / "Finanzen" + / "Bank" + / str(year) + ) + + target_dir.mkdir( + parents=True, + exist_ok=True + ) + + target_file = ( + target_dir / excel_file.name ) - copy2(excel_file, target) + copy2( + excel_file, + target_file + ) print( - f"Excel nach {target} kopiert." + f"Excel nach {target_file} kopiert." ) except Exception as e: @@ -408,7 +421,6 @@ elif platform.system() == "Windows": print( f"Nextcloud-Kopie fehlgeschlagen: {e}" ) - else: print(