In my script, I call the
zip-command with the full path of the archive and the target directory like so:
zip -r /srv/www/htdocs/xxx/system/tmp/build/tmp_build.zip /srv/www/htdocs/xxx/system/tmp/build/tmp_build_dir_1344856484/
tmp_build_dir_1344856484-directory tree looks as follows:
+ |-- output.xml |-+ ressources/ |- some_file.png |- another_file.png
My problem now is, that I need the root of the zip-archive to have the XML file and the
ressources-folder, but currently, the archive also includes the full path name.
# Wanted path to some_file.png in zip-file: /ressources/some_file.png # What I currently get: /srv/www/htdocs/xxx/system/tmp/build/tmp_build_dir_1344856484/ressources/some_file.png
How can I truncate the path just to a certain level so I can keep the sub-folder but not have the whole directory tree in it?