18 lines
486 B
Python
18 lines
486 B
Python
import pexpect, time
|
|
|
|
c = pexpect.spawn('ssh -q -o StrictHostKeyChecking=no root@210.16.161.214', encoding='utf-8', timeout=30)
|
|
c.expect('password:')
|
|
c.sendline('XHR521yhf')
|
|
c.expect('[$#]')
|
|
|
|
c.sendline('tail -30 /tmp/deploy_velobase.log 2>/dev/null')
|
|
c.expect('[$#]')
|
|
print('=== LOG ===')
|
|
print(c.before.strip()[-2000:])
|
|
|
|
c.sendline('ps aux | grep deploy_velobase | grep -v grep || echo DONE')
|
|
c.expect('[$#]')
|
|
print('=== STATUS ===')
|
|
print(c.before.strip()[-300:])
|
|
|
|
c.sendline('exit') |