Skip to content

Instantly share code, notes, and snippets.

@7rin0
Created May 24, 2017 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7rin0/bc14fe4009425dffa7acfd6696bbfa63 to your computer and use it in GitHub Desktop.
Save 7rin0/bc14fe4009425dffa7acfd6696bbfa63 to your computer and use it in GitHub Desktop.
Split and Join sources into tar pieces

Scenario:

We have a compressed sql dump with a size of 10 Gb and we need to upload into free storage limited by 1Go each upload.

SOURCE:

dump.tar (or any other folder, tar, file, directory, etc)

TARGET:

dump_sql.tar. (will be suffixed by each part id)

SPLITTED FILE SIZE:

1Gb / 1000MB

SPLIT COMMAND:

tar cvzf - dump.tar | split --bytes=1000MB - dump_sql.tar.

JOIN COMMAND:

cat dump_sql.tar.* > dump.tar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment