Skip to content

Old news about ftp.

October 13, 2005

This is for many old news. However since I was asked again today this will at least be there for google.

One of the most efficient ways to move a crash dump from one location to another is as a compressed tar file over ftp. However if you wish to keep looking at a file while it is being copied or you don’t have enough space to compress the dump this appears to be impossible. There is however a way.

The ftp client has a well hidden option where it will send the output of a pipe line to the remote server as the file. So you send it the output from “tar cf – . | gzip” or even “tar cvf – . | gzip” and save that on the server as file.tar.gz. Here is an example of sending a large crash dump to “affa” when there was not enough space to compress it:

: enospc.eu TS 3 $; ftp affa

Connected to affa.

220 FTP server ready.

530 Please login with USER and PASS.

331 Guest login ok, send your complete e-mail address as password.

230 Guest login ok, access restrictions apply.

Remote system type is UNIX.

Using ascii mode to transfer files.

ftp> bin

200 Type set to I.

ftp> cd /pub/incoming

250 CWD command successful.

ftp> put “|tar cvf – *.2 | gzip” dumps.2.tar.gz

200 PORT command successful.

a act.2 319K

150 Opening BINARY mode data connection for dumps.2.tar.gz.

a unix.2 845K

a vmcore.2 4200272K

226 Transfer complete.

353675655 bytes sent in 2e+03 seconds (1.7e+02 Kbytes/s)

ftp>

What compression to use

There are 3 compression programs commonly in use. These are compress(1), gzip(1) and bzip2(1). Don’t use compress as gzip will do a much better job of the compression. “gzip -best” will give you the best compression that it can do. “bzip2generally gets even better compression but can take an extraordinarily long time.

Ftp server commands

When pulling crash dumps the new ftp servers can also help. Solaris 9 and above ftp servers can also support compression and or tar via an extension on the file name some servers that use gtar will support both. For example I can pull a compressed tar file:

: montgomery.eu IA 45 $; ftp affa

Connected to affa.

220 FTP server ready.

530 Please login with USER and PASS.

331 Guest login ok, send your complete e-mail address as password.

230 Guest login ok, access restrictions apply.

Remote system type is UNIX.

Using ascii mode to transfer files.

ftp> bin

200 Type set to I.

ftp> cd pub

250 CWD command successful.

ftp> get large_directory.tar.gz /tmp/p.tar.gz

200 PORT command successful.

150 Opening BINARY mode data connection for /usr/sfw/bin/gtar.

226 Transfer complete.

32040960 bytes received in 59 seconds (5.3e+02 Kbytes/s)

ftp> quit

221-You have transferred 32040960 bytes in 1 files.

221-Total traffic for this session was 32041505 bytes in 1 transfers.

221-Thank you for using the FTP service on procrastinate.

221 Goodbye.

Solaris 9 support the following postfixes by default

Postfix

Description

.Z

Compress using the compress command

.gz

Compress using the gzip command

.bz2

Compress using the bzip2 command

.tar

Archive using the tar command

Tags: topic:[solaris] topic:[ftp]

Advertisements

From → Solaris

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: