Create cron1m.py

This commit is contained in:
kadma
2024-01-21 12:22:17 -05:00
committed by GitHub
parent 1f948a6c65
commit 1bdd88289b

21
onedrive/cron/cron1m.py Normal file
View File

@@ -0,0 +1,21 @@
import os
import schedule
import time
import subprocess
def ejecutar_comando():
comando = os.environ.get('SUPERCOMANDO', default=None)
if comando is not None:
subprocess.run(comando, shell=True)
else:
print("La variable de entorno no tiene un valor definido.")
schedule.every(1).minutes.do(ejecutar_comando)
while True:
# Ejecuta las tareas pendientes
schedule.run_pending()
# Espera 1 segundo antes de volver a verificar
time.sleep(1)