📜  bash multipart tar - Shell-Bash (1)

📅  最后修改于: 2023-12-03 15:13:36.834000             🧑  作者: Mango

Bash Multipart Tar - Shell-Bash

Bash Multipart Tar is a script written in Bash that allows you to split large tar archives into smaller, more manageable parts. This is particularly useful for transferring large files over slow or unreliable network connections, as well as archiving large amounts of data on removable media.

The script works by first creating a tar archive, and then splitting it into multiple smaller tar files. The tar files are named using a sequential numbering scheme, making it easy to recombine them in the correct order at a later time.

To use the script, simply specify the name of the tar archive, the maximum size per part, and the output directory. The script will then create the tar archive and split it into the specified number of parts.

bash multipart_tar.sh -n max_size -o output_dir tar_file

Where:

  • max_size is the maximum size per part in megabytes (default is 100MB)
  • output_dir is the directory to save the resulting tar files (default is current directory)
  • tar_file is the name of the tar archive to be split
Example
bash multipart_tar.sh -n 200 -o /home/user/backups /mnt/backup_drive/backup.tar

This will create multiple tar files (with sizes of approximately 200MB each) in the /home/user/backups directory.

Conclusion

Bash Multipart Tar is a simple and effective way to split large tar archives into more manageable parts. Its ease of use and simple interface make it an ideal tool for those who need to transfer or archive large amounts of data.