Files
SnarfCode/scripts/find_swarm_compose.py

15 lines
546 B
Python

import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('140.44.4.71', username='snarf', key_filename=r'C:\Users\Snarf\.ssh\id_ed25519_snarfnet', timeout=10)
stdin, stdout, stderr = ssh.exec_command('ls -la /home/snarf')
print("=== /home/snarf ===\n", stdout.read().decode())
stdin, stdout, stderr = ssh.exec_command('find /home/snarf /opt /var/docker -maxdepth 3 -name "*compose*" -o -name "*stack*" 2>/dev/null')
print("=== COMPOSE FILES ===\n", stdout.read().decode())
ssh.close()