summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Olech <nddr89@gmail.com>2021-06-24 13:19:43 +0200
committerAdam Olech <nddr89@gmail.com>2021-06-24 13:19:43 +0200
commitcb07e1cde63c9f10acf4f08b29662ecc0e646dc7 (patch)
tree7aeb8d3c1c48773ce0da578a101cb6237b2c20cb
parent680f65e237d6000499d0d1a7c83a79e644b52579 (diff)
Strip leading prefix
-rwxr-xr-xtar_over_paramiko.py7
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