Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

Linux: Trouble with very large file

I created a tar archive like this:

tar czf foobar.tar.gz /my/dir/

The size of the file is 6 GB.

I need to send the file to a different computer using FTP but I get an error:
Error: File `foobar.tar.gz' does not exist.

So I tried to split it but I got an error:
split: cannot open `foobar.tar.gz' for reading: No such file or directory

I can see the file using "ls -lh"
-rw-r--r--   1 myuser mygroup 6.4G Dec 28 09:11 foobar.tar.gz

What should I do?  Is there a way to create multiple smaller tar files?  Or is there a way to send the file?

I use CentOS 4 (32 bit).
Avatar of arnold
arnold
Flag of United States of America image

Is ftp the only way to get to the other system?
Is there an option to establish an ssh session and pump the data through
ssh user@remotesystem "tar cf - /my/dir/" | gzip -c >/where/there/is/enough/space/for/foobar.tar.gz
The - in the tar command indicates that the result should be sent to Standard Output.
What filesystem  is the file stored on? ext2/ext3?
Avatar of hankknight

ASKER

Unfortunately FTP is the only way I can connect to the remote system.

How can I find out what filesystem is used?
On your system the command is:
mount

It will display the mounted devices with the filesystem type follows the type <filesystem>.

I do not believe that the 6GB is an issue.
Which ftp client are you using?

try
tar cf - | gzip -c | split -b <split_file_size>


where split_file_size if 500m you will end up with 12files.
xaa-xal

See if that gets the process moving along.  
The data is stored on ext2.

Thanks, but I don't understand how to create a split tar.

The directory that I want to archive is: /my/dir/

This code does NOT work:
tar cf foobar.tar - | gzip -c | split -b 700m /my/dir/

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of arnold
arnold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial