Quick SSH Zip Command Question

Discussion in 'Site & Server Administration' started by mjwoodi, Mar 3, 2010.

  1. #1
    Hi,

    When I SSH into my hosting, in the root I have a list of folders, each folder is a different website.

    What I want to do is zip up every single folder/subfolder from root and I believe this is the right command to do so-

    
    zip -r backup.zip *
    
    Code (markup):
    But when I typed this in and hit enter, nothing happenes?

    Is that the right command? I put the * at the end because im in the root folder and want to zip up everything in root and below

    Thanks
     
    mjwoodi, Mar 3, 2010 IP
  2. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #2
    I would suggest instead of running that from the root folder, that you change directories into another directory, then try running the following:

    zip -r backup /root/
    Code (markup):
    The file name will end up being backup.zip, as it adds the extension to the end.
     
    RHS-Chris, Mar 3, 2010 IP
  3. FavouritesBlog

    FavouritesBlog Peon

    Messages:
    846
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #3
    gtar is best for compressing files in linux.
     
    FavouritesBlog, Mar 3, 2010 IP