The tar.gz created is not having execute rights when transferred on linux after creation.
Goal: File should have full rights once it is taken on linux system.
I am using 'tarfile' library in python to achieve this.
import os
import tarfile
with tarfile.open('test.tar.gz', "x:gz") as tar:
tar.add("path_to_src_folder", arcname=os.path.basename("path_to_dir", filter=tarinfo.mode(777))
----------------OR-------------------------------------------
import tarfile
def set_permissions(tarinfo):
tarinfo.mode = 777
return tarinfo
with tarfile.open('test.tar.gz', "x:gz") as tar:
tar.add("path_to_src_folder", filter=set_permissions)