1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How do I UNTAR a TAR file on web host?

Discussion in 'Site & Server Administration' started by webber98, Mar 5, 2010.

  1. #1
    I'm having a real tough time getting this done correctly.

    I'm on a LINUX server. Control panel is H-SPHERE with WebShell as the file manager tool.

    I TAR'd some files from one site then brought it over from another site. When I untar it using the WebShell tool, it seems to set all the folders/files with the same permissions, and does not retain the original permissions.

    Is there a better way to do this? I tried WS_FTP_PRO, and some other tools, but i just can't get it work correctly.

    Advice and insight so I can do this correctly would be great. thanks in advance.
     
    webber98, Mar 5, 2010 IP
  2. Guttu

    Guttu Peon

    Messages:
    728
    Likes Received:
    88
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just change the ownership and owner group using chown and chgrp. Not diificult task
     
    Guttu, Mar 6, 2010 IP
  3. slacker8

    slacker8 Peon

    Messages:
    176
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    From "man tar":
    or
    Should help you.
     
    slacker8, Mar 6, 2010 IP
  4. ammyy

    ammyy Peon

    Messages:
    11
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    from ssh:

    Creating a tar file:

    tar -cvwf file.tar myfile.txt

    In the above example the system would create a tar named file.tar in the directory you currently are in. Wildcards could also be used in this command, for example: tar -cvwf file.tar *.txt would compress all txt files in the current directory.

    tar -cvwf home.tar home/

    In the above example command the system would create a tar file named home.tar in the directory you currently are in of the home directory.

    Extracting the files from a tar file:

    tar -xvwf myfile.tar

    In the above example command the system would uncompress (untar) the myfile.tar file in the current directory.

    tar -xvwzf myfile.tar.gz

    In the above example command the system would uncompress (untar) the myfile.tar.gz file in the current directory.

    source: http://r00tsecurity.org/forums/index.php?showtopic=18405
     
    ammyy, Mar 7, 2010 IP
  5. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #5
    untar is the easiest if u have shell access questions is do u have it ???
     
    Bohra, Mar 7, 2010 IP
  6. etc

    etc Well-Known Member

    Messages:
    3,232
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    158
    #6
    nothing special just tar xvf filename.tar
     
    etc, Mar 7, 2010 IP
  7. mhuffs9017

    mhuffs9017 Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Once the directory is untarred why not just go back and recursively change the file perms/owners to what they need to be.

    tar xvf /tmp/myfile.tar /home/user/htdocs

    Then recursivley change the file owners in htdocs

    chown -R user:group /home/user/htdocs
     
    mhuffs9017, Mar 8, 2010 IP