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.

SSH to gzip and download to local machine

Discussion in 'Site & Server Administration' started by midwestbonsai, Jan 21, 2010.

  1. #1
    Is there a way to gzip a directory on my server via SSH and then download it to my local machine via SSH?
     
    midwestbonsai, Jan 21, 2010 IP
  2. hostechsupport

    hostechsupport Well-Known Member

    Messages:
    413
    Likes Received:
    23
    Best Answers:
    7
    Trophy Points:
    138
    #2
    You can use gzip command to compress the file in linux system, and yes you can download it directly to your local machine via SSH. Just open the new file transfer window from WINDOW option in SSH and select the zip file to download.

    Sytnax :-

    gzip filename
     
    hostechsupport, Jan 21, 2010 IP
  3. midwestbonsai

    midwestbonsai Well-Known Member

    Messages:
    402
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #3
    Thanks, could you explain a bit more on the WINDOW option?
     
    midwestbonsai, Jan 21, 2010 IP
  4. webtalk

    webtalk Well-Known Member

    Messages:
    283
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    135
    #4
    ssh to ip-adress login with user and password

    tar czvf yourfilename.tar.gz /path/to/folder or file

    now download to your local machine

    scp ip-address:/path/to/gzipfile .

    i.e scp 10.78.34.5:/home/test/test.tar.gz .

    hope this helps
     
    webtalk, Jan 21, 2010 IP
  5. midwestbonsai

    midwestbonsai Well-Known Member

    Messages:
    402
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #5
    When I change this to my info I get a connection timeout error.
    Doesn't seem like anything has happened.
     
    midwestbonsai, Jan 21, 2010 IP
  6. wgcom

    wgcom Peon

    Messages:
    157
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    you run windows on you local machine? - > use winscp
    if linux then you run scp on local machine not on remote, coz prolly you behing router and the remote cant open connection to local.
     
    wgcom, Jan 21, 2010 IP
  7. BestNetCraft

    BestNetCraft Well-Known Member

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #7
    >> Is there a way to gzip a directory on my server via SSH and then download it to my local machine via SSH?

    Easy.

    Get Putty.exe and pscp.exe and place them in your windows\system32 in your local Windows machine.

    Fire up putty and login to your server through SSH.

    Navigate to one directory above your directory which you want gzipped.

    Type tar -cvzf some-directory.tgz directory

    Your server will gunzip the directory and save that as some-directory.tgz

    Now switch to your windows cmd prompt.

    Type this:
    pscp user@your-server:/path-to-your-file C:\

    You are done.
     
    BestNetCraft, Jan 27, 2010 IP