Is it possible to pipe data into an SRB command? I've assumed it isn't, because I saw an HSI page that seemed to imply that SRB couldn't. To work around that, I've written a python script I've named "chunkup", which reads from stdin, and writes a series of arbitrarily-sized blocks with unique names (one at a time, it's not just a "split" clone), and then os.system()'s a user-specified command (EG, an Sput wrapper that sets an SRB CWD) to transfer data, prior to removing the copy of the block on the local system.

In this way, you can transfer a tar archive that's too large to fit into a local filesystem, via SRB or other program that doesn't understand pipes.

Usage is like:

Usage: /usr/local/etc/chunkup -c chunkhandlerprog -n nameprefix [-t tmpdir] [-b blocksize]
-c specifies the chunk handling program to handle each chunk, and is required
-n specifies the nameprefix to use on all files created, and is required
-t specifies the temporary directory to write files to, and is optional.  Defaults to $TMPDIR or /tmp
-b specifies the length of files to create, and is optional.  Defaults to 1 gigabyte
-d specifies the number of digits to use in filenames.  Defaults to 5

You can download it here.


Hits: 5706
Timestamp: 2024-12-23 07:25:43 PST

Back to Dan's tech tidbits

You can e-mail the author with questions or comments: