How to create zip on Linux server?

Discussion in 'Site & Server Administration' started by rolf, Sep 15, 2008.

  1. #1
    Hi,

    I've got a shared account at Hostgator so no access to command line.

    Can anyone point me to a good script that allows easy backup of selected folders and retain the unix permissions?

    I've looked and all I can find is example source code which is not suitable for my needs. And with very basic PHP knowledge, I find it impossible to edit.

    btw Hostgator run cpanel X2.6 so no compress zip functionality built in to cpanel :(

    Would really appreciate any help.

    thanks
     
    rolf, Sep 15, 2008 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
  3. rolf

    rolf Active Member

    Messages:
    1,449
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #3
    Hey thanks, I managed to do it with "zip" unix command in the end.

    But here's something I don't understand. I want to create a .zip with permissions preserved (755 for folders, 644 for files).

    But I am told that .zip does not preserve permissions. I need to use tar or tar.gz.

    So why is it that with wordpress themes, when I uncompress the .zip file:

    sometimes everything is 666
    and sometimes the folders are 755 and the files are 644.

    I don't understand this difference. If I upload a zip created in XP, then I get 666 for everything.

    So how can I explicitly set permissions?
     
    rolf, Sep 15, 2008 IP
  4. rolf

    rolf Active Member

    Messages:
    1,449
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    90
    #4
    well i fixed it.

    If I zip with winzip, everything goes to 666
    If I zip with 7-zip, I get good default permissions of 755/644.

    How bizarre!!
     
    rolf, Sep 15, 2008 IP