diff options
| author | Adam Olech <nddr89@gmail.com> | 2021-06-24 13:19:43 +0200 |
|---|---|---|
| committer | Adam Olech <nddr89@gmail.com> | 2021-06-24 13:19:43 +0200 |
| commit | cb07e1cde63c9f10acf4f08b29662ecc0e646dc7 (patch) | |
| tree | 7aeb8d3c1c48773ce0da578a101cb6237b2c20cb | |
| parent | 680f65e237d6000499d0d1a7c83a79e644b52579 (diff) | |
Strip leading prefix
| -rwxr-xr-x | tar_over_paramiko.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tar_over_paramiko.py b/tar_over_paramiko.py index fd7dbc1..2a7285e 100755 --- a/tar_over_paramiko.py +++ b/tar_over_paramiko.py @@ -31,13 +31,14 @@ stdin.channel.shutdown_write() paths = [] for l in stdout: - paths.append(l.strip('\n')) - print('[FIND STDOUT]\t{}'.format(paths[-1])) + paths.append(l.strip('\n').split(sys.argv[4] + '/')[1]) + print('[FIND STDOUT]\t{}'.format(l.strip('\n'))) + print('[FIND ALTERD]\t{}'.format(paths[-1])) for l in stderr: print('[FIND STDERR]\t{}'.format(l.strip('\n'))) -stdin, stdout, stderr = ssh.exec_command('tar cf - -T -') +stdin, stdout, stderr = ssh.exec_command('tar cf - -C {} -T -'.format(sys.argv[4])) stderr_lines = 0 stdout_lines = 0 stdout_type = None |
