compress files Into Several Parts by putty

Discussion in 'Site & Server Administration' started by sample4u, Jan 3, 2011.

  1. #1
    Hi

    I will compress files Into Several Parts by putty on linux server, 1000+ files so i will compress files into several files example:

    file1.tar or .zip
    file2.tar or .zip
    file3.tar or .zip
    ...

    transfer files to new server and after it merge files and extract complete package

    How can do?

    Thank you,
    happy holidays.
     
    sample4u, Jan 3, 2011 IP
  2. tolra

    tolra Active Member

    Messages:
    515
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    80
    #2
    Make a tar or zip file of the data then on the source machine: split --bytes=10m /path/to/source/file.tar.gz /path/to/store/split/prefix

    That will split the file into 10MByte chunks putting them in the folder /path/to/store/split with each file starting with the word prefix.

    Copy the splits to the target server then: cat prefix* > file.tar.gz

    You should have the whole file back.

    As you are going server to server and unless you have a really naff connection on one of the servers I'd simply create a compressed tar file e.g. tar czf /file.tgz * and copy that whole file as is between the servers.
     
    tolra, Jan 3, 2011 IP