creación de scheduler.json para ejecución de servicio

This commit is contained in:
George committed 2026-08-04 09:34:44 -05:00
1 parent 839aad698d
commit 1c39f6f45f
11 files changed
+112 -400

No files matched your search

+7 -5
View File
@@ -5,6 +5,7 @@ import subprocess
from pathlib import Path
from dotenv import load_dotenv
# ============================================================================
load_dotenv()
SMB_SERVER = os.getenv("SMB_SERVER", "").strip()
@@ -16,7 +17,7 @@ SMB_MOUNT_MAC = os.getenv("SMB_MOUNT_MAC", "").strip()
SMB_MOUNT_LINUX = os.getenv("SMB_MOUNT_LINUX", "").strip()
SMB_MOUNT_WINDOWS = os.getenv("SMB_MOUNT_WINDOWS", "").strip()
# ============================================================================
def get_current_os():
system = platform.system().lower()
if system == "darwin":
@@ -25,7 +26,7 @@ def get_current_os():
return "windows"
return "linux"
# ============================================================================
def get_mount_point():
current_os = get_current_os()
mapping = {
@@ -35,7 +36,7 @@ def get_mount_point():
}
return mapping.get(current_os, "")
# ============================================================================
def esta_montado(mount_point):
if not mount_point:
return False
@@ -45,7 +46,7 @@ def esta_montado(mount_point):
os.path.join(mount_point, ".mounted_check")
)
# ============================================================================
def montar_smb():
mount_point = get_mount_point()
if not mount_point:
@@ -87,7 +88,7 @@ def montar_smb():
print(f" ⚠️ Error montando SMB: {e}")
return False
# ============================================================================
def sincronizar_a_smb(ruta_local):
if not os.path.isdir(ruta_local):
print(f" ⚠️ La carpeta local no existe: {ruta_local}")
@@ -152,3 +153,4 @@ def sincronizar_a_smb(ruta_local):
except Exception as e:
print(f" ❌ Error en sincronización: {e}")
return False
# ============================================================================