import os import subprocess import threading def start_backup_service(): proc = subprocess.Popen( ["python3", "/backup.py"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, bufsize=1 ) # Stream logs in real-time for line in proc.stdout: print("[Backup]", line.strip()) print("Starting Restorer.") subprocess.run(["python3", "/restore.py"], check=True) print("Finished.") print("Starting Auto-Backup Service.") thr = threading.Thread(target=start_backup_service, daemon=True) thr.start() print("Starting Coder server.") subprocess.run([ "code-server", "--bind-addr", "0.0.0.0:7860", "--auth", "none", "/home/vscode/workspace" ])