I have tar.gz file like:
tmp/
tmp/picture/
tmp/picture/1.jpg
I want to add to this tar.gz file with python file to tmp/logger.sh with chmod +x
How can I do that ?
import tarfile
with tarfile.open('test.tar.gz','w') as f:
f.add('logger.sh' , arcname='/tmp/logger.sh')
That give me tar file /tmp/logger.sh file but remove the rest of files that was in the tar file + I can't set chmod +x to this file