How to change zip archives method (creating full path) ?

afdownload

Verified User
Joined
Dec 25, 2010
Messages
5
I have compressed many zip files in DirectAdmin,
but there is a problem with it.
it creates the file in a full path like this:
domains/afdownload.com/public_html/forum/old/upload/images
i don't want this, i just want directadmin to create the destination directory
images/files
please help me out with this, it's very important for me.
 
for example I compress IMAGES folder it creates the file like this:
domains/afdownload.com/public_html/forum/old/upload/images/files

I just want it to create the specified folder with all files like this:
images/files
 
I can't do that,
I have more than 20 users. i can't tell them to go to ssh to compress a folder. that is not sensible. there should be a way to compress files through directadmi file manager?
 
I'm not sure, but you might want at least to try with all_pre.sh and all_post.sh scripts in order to pass your own arguments to zip. That's just an idea, that should be verified.

Some clarification can be found here, it's there all about tar.gz, but I think the same can be said about zip archives:

This is important for extracting, because the "extract to" path must be set to / (the home directory) when extracting a tar.gz file made with this method so that the files are restored in the correct location. Only when extracting a tar made somewhere else (ie a forum, or anything) will extracting to the specified directory really work with the expected paths.
 
Hello,
Code:
cd /home/username/domains/afdownload.com/public_html/forum/old/upload/images/

Code:
zip -r files.zip files
credit: SeLLeRoNe
:D
 
Hello,
Code:
cd /home/username/domains/afdownload.com/public_html/forum/old/upload/images/

Code:
zip -r files.zip files
credit: SeLLeRoNe
:D

You may be right, but i want the directadmin file manager to compress the files without the full directory path. i have more than 20 users. I can't give all of them SSH access and teach them to work with linux. i wonder why compressing in directadmin is this way, cpanel easily compresses the files and folders in a normal manner. still waiting for a solution?
 
Have you checked to see if there's a Feature Request thread? If so, that's the place for your post. If not, then consider creating one :).

Jeff
 
@afdownload,

i wonder why compressing in directadmin is this way

the answer from an official source was already given:

This is important for extracting, because the "extract to" path must be set to / (the home directory) when extracting a tar.gz file made with this method so that the files are restored in the correct location. Only when extracting a tar made somewhere else (ie a forum, or anything) will extracting to the specified directory really work with the expected paths.

http://directadmin.com/features.php?id=421


You might want to use either all_pre.sh and all_post.sh scripts or follow Jeff's recommendation.
 
Back
Top