I'm trying to upload my tar'ed site to server but I have upload limit. My ftp program extracts tar after uploading it. How do I split this one tar into two so I could upload one tar and let it extract itself, and then upload second one and let it extract itself too?
1 Answer
If you have an upload limit, splitting the file into two won't change anything. The two files will combine to almost exactly the same size as the original.
Or did you mean you have a limit on maximum file size uploaded? If so, just tar only some of the files, then tar the rest, e.g. if you are archiving the contents of the directory /home/name/files, and that contains directories one, two, three and four:
tar cvzf first.tgz /home/name/files/one /home/name/files/two
tar cvzf second.tgz /home/name/files/three /home/name/files/four
If you have shell access on the server, you could just use split(1) to cut your single tar archive in half and recombine it on the other side.
Also, are you creating "tar" files, or compressed tars, either gzip or (slightly better compression) bzip2? Obviously compressed archives will be smaller.
-
I have a limit on max size uploaded per one file. I'm creating .tar files.– meaFeb 2, 2010 at 6:19
-
What's z? I use cf only.– meaFeb 2, 2010 at 6:32
-
In GNU tar the 'z' option tells it to compress with gzip after the tar is put together. The
tar cvzf
command becomes a single tar and compress. I hope your FTP program knows what to do with atgz
file? (same astar.gz
)– paviumFeb 2, 2010 at 6:55 -
Also "j" will use bzip2 compression (slightly better, as I mentioned). It is, however, slower than gzip compression.– CarlFFeb 2, 2010 at 15:01