I am trying to archive 2 files but not the full path leading up to the two files. Hopefully someone can point me in the right direction:
My directory structure is as follows. I only have two files which I want backed up.
/tmp
my_stuff
-hello.html
-hello2.html
So per the documentation, shutil.make_archive can zip up entire directories. I am using the following command:
shutil.make_archive( base_name = '/tmp/package',
format = 'zip',
root_dir = '/tmp/my_stuff',
base_dir = '/tmp/my_stuff' )
This command successfully creates the zip file however when I do "unzip package.zip from within the /tmp folder", I get the following:
➜ /tmp unzip package.zip
Archive: package.zip
creating: tmp/my_stuff
inflating: tmp/my_stuff/hello.html
inflating: tmp/my_stuff/hello2.html
It creates a duplicate "tmp" within tmp and a new folder called my_stuff and the 2 files. All I want is for it to extract the two files (without the directories). Any advice would be appreciated.
Thanks