import paramiko, sys, time sys.stdout.reconfigure(encoding='utf-8', errors='replace') c = paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect('101.79.17.164', username='root', password='1q2w3e!Q', timeout=15) def run(label, cmd, timeout=30): print(f'\n[{label}]') _, o, _ = c.exec_command(cmd, timeout=timeout) print(o.read().decode('utf-8','replace').strip()[:400]) # backend static → www 강제 복사 (rsync 방식) run('강제 복사', 'rsync -a --update /opt/zioinfo/src/backend/src/main/resources/static/. /var/www/zioinfo/ && ' 'echo "완료"') run('GuardiaDetail CentRZHt 확인', 'ls -lh /var/www/zioinfo/assets/GuardiaDetail*.js | sort -k8 -r | head -3') run('index.html 업데이트 확인', 'grep -o "GuardiaDetail[^\"]*" /var/www/zioinfo/index.html | head -2') run('서비스 재시작', 'systemctl restart zioinfo && sleep 3 && systemctl is-active zioinfo') c.close() print('\n완료')