vs / app.py
etsadiz's picture
Update app.py
3fd09a5 verified
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
)
for line in proc.stdout:
print("[Backup]", line.strip())
print("Starting Restorer...")
subprocess.run(["python3", "/restore.py"], check=True)
print("Restore Completed.")
print("Starting Auto-Backup Service...")
threading.Thread(target=start_backup_service, daemon=True).start()
print("Starting VSCode server...")
subprocess.run([
"code-server",
"--bind-addr", "0.0.0.0:7860",
"/home/vscode/workspace"
])