Extract tar.gz on the FTP?


#1

Hi!

I’m tired of uploading tons of files, and was wondering if it’s possible to upload a tar.gz file and just extract it on the server? It would save me a lot of time.


#2

Yes, but not through FTP. You’ll need to use FTP to upload the file and then use SSH to gain command line access where then you can extract the file.

The command to extract a file is: tar zxf file.tar.gz

x - extract
z - it’s gzipped
f - supplying filename on command line.

If the file is on a remote server (and you’re just using your desktop as a “proxy” to xfer files) you can get even fancier and use wget to download the directly on your site. Again, through SSH command is: wget http://domain.com/url/to/file.tar.gz

Then use the above tar command to extract it.


yerba# rm -rf /etc
yerba#


#3

Ok. That’s what I was hoping for :slight_smile: Thanks a lot, this will help me save time so I don’t have to upload a gazillion small files :slight_smile: I’m testing CMS’s, so it’s a drag everytime I wanna test a new one =)


#4

You could also save time by downloading straight to the server in shell using

wget http://example.com/file.tar.gz
or
wget ftp://ftp.example.com/file.tar.gz


#5

I’ll check that out when I can. Most of what I’ve downloaded now is from SourceForge sites, so can’t really do that there I think :slight_smile:


#6

Hm. What info do I need to connect via SSH? I used my domain name, and then I got queried for username and password, so I tested what I use to log in @ dreamhost.com control panel, but that didn’t do the trick :confused:


#7

You have to log in with the user associated with the domain you want to access. That user also has to have been granted shell access from the panel. See the wiki article ‘ssh’ for more help.

You can downalod directly to the server from sourceforge. in your browser, find the file you want, selecte the mirror, then when the save as box pops up on your screen just click cancel and copy the url at the top of the page. it says, if your download doesn’t start automatically try this link: http://… just plug that into wget. I normally take a mirror in Arizona as that seems to be the closest one.

–Matttail
art.googlies.net - personal website


#8

Ok, I’ll see what I can find out, and I’ll check teh wget thing also :slight_smile:

Thansk for being patient!


#9

It all worked, both wget and the extracting thing. Had to enable SSH for my user.

This is very nice :smiley: thanks a lot people! This will make things so much easier =)

Btw, I’m in Sweden (I’m Norwegian though), used wget and a mirror from Dublin, worked like a charm.


#10

To save on unnecessary bandwidth, you should select a mirror close to the server, which is located in US, California, L.A… Rather than making it download the same file across the ocean, let it download the file from only a few hundred miles.

Glad to hear you got things working thoough.

–Matttail
art.googlies.net - personal website


#11

Ah, of course, I forgot the server is in the states :wink: yeah, I’ll do that next time, thx :slight_smile:

Yeah, it all good now, nice to finally know this, have wondered about these things for a long while now, just never gotten around to try and figure it out.