Nextcloud sync
This commit is contained in:
parent
7a1af96a19
commit
3417bd248d
1 changed files with 18 additions and 6 deletions
|
|
@ -375,7 +375,7 @@ if which("rclone"):
|
||||||
"rclone",
|
"rclone",
|
||||||
"copy",
|
"copy",
|
||||||
str(excel_file),
|
str(excel_file),
|
||||||
"nextcloud:Finanzen"
|
f"nextcloud:Bank/{year}"
|
||||||
],
|
],
|
||||||
check=True
|
check=True
|
||||||
)
|
)
|
||||||
|
|
@ -390,17 +390,30 @@ elif platform.system() == "Windows":
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
target = (
|
target_dir = (
|
||||||
Path.home()
|
Path.home()
|
||||||
/ "Nextcloud"
|
/ "Nextcloud"
|
||||||
/ "Finanzen"
|
/ "Bank"
|
||||||
|
/ str(year)
|
||||||
|
)
|
||||||
|
|
||||||
|
target_dir.mkdir(
|
||||||
|
parents=True,
|
||||||
|
exist_ok=True
|
||||||
|
)
|
||||||
|
|
||||||
|
target_file = (
|
||||||
|
target_dir
|
||||||
/ excel_file.name
|
/ excel_file.name
|
||||||
)
|
)
|
||||||
|
|
||||||
copy2(excel_file, target)
|
copy2(
|
||||||
|
excel_file,
|
||||||
|
target_file
|
||||||
|
)
|
||||||
|
|
||||||
print(
|
print(
|
||||||
f"Excel nach {target} kopiert."
|
f"Excel nach {target_file} kopiert."
|
||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
@ -408,7 +421,6 @@ elif platform.system() == "Windows":
|
||||||
print(
|
print(
|
||||||
f"Nextcloud-Kopie fehlgeschlagen: {e}"
|
f"Nextcloud-Kopie fehlgeschlagen: {e}"
|
||||||
)
|
)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
print(
|
print(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue