This commit is contained in:
2026-05-18 06:33:50 +02:00
parent 92e2585433
commit 0d724c536d
+6 -2
View File
@@ -128,10 +128,16 @@ try:
except Exception as e:
print(f"Varovani: nepodarilo se zkontrolovat pripojeni ({e})\n")
# Zastav Firebird, smaz DB, spust znovu
TARGET_DB.parent.mkdir(parents=True, exist_ok=True)
print("Stavim sluzbu FirebirdServerCGM...")
subprocess.run(["net", "stop", "FirebirdServerCGM"], capture_output=True)
if TARGET_DB.exists():
TARGET_DB.unlink()
print(f"Smazana stara DB: {TARGET_DB}")
print("Spoustim sluzbu FirebirdServerCGM...")
subprocess.run(["net", "start", "FirebirdServerCGM"], capture_output=True)
time.sleep(3)
cmd = [str(GBAK), "-rep", "-v", str(extracted), str(TARGET_DB), "-user", USER, "-pas", PASSWORD]
print(f"\nSpoustim: {' '.join(cmd)}\n")
@@ -149,8 +155,6 @@ try:
success = True
print(f"\nObnova dokoncena. Cas: {minutes}:{seconds:02d} (min:sec)")
LAST_RESTORED.write_text(latest_zip.name, encoding="utf-8")
latest_zip.unlink()
print(f"Smazan ZIP: {latest_zip.name}")
extracted.unlink()
print(f"Smazan FBK: {extracted.name}")
# Test DB - pocet registrovanych pacientu