You can use
tar, with these options:
At the end of each volume it will call your script, that will have some environment variables to know which volume has just been processed. Check the manual page for the full list, but at least the variable
TAR_VOLUME is pretty useful, in case you have to rename the output file, or keep somehow track of the current volume:
Ordinal number of the volume
tar is processing (set if
reading a multi-volume archive).
If the script returns 0,
tar will continue, otherwise it will stop.
For example, this will create each volume, with a maximum size of 20 M, calling your script each time the limit is reached:
tar cvf /tmp/volume.tar /path/to/files/ --new-volume-script=/path/to/myscript.sh --tape-length=20M
The script can be a simple
echo "Next volume";read or you could even do the transfer from it (renaming the volume, because once you exit
/tmp/volume.tar will be overwritten).
On the other side, be sure to use the flag
--multi-volume. If you don't, tar will stop with the errors (I leave it in case somebody searches for the error):
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
tar xvf /path/to/transferred.volume --multi-volume
Prepare volume #2 for /path/to/transferred.volume and hit return:
tar will prompt you for the new volume. Once you press Enter,
/path/to/transferred.volume will be opened again, and so on.