File size: 678 Bytes
b79920e 3fd09a5 b79920e 3fd09a5 b79920e 3fd09a5 b79920e 3fd09a5 b79920e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | 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"
])
|