When GNUandtarcomes to the end of a storage media, it asks you to change the volume. The built-in prompt for POSIX locale is(23):
where n is the ordinal number of the volume to be created and archive is archive file or device name.
Prepare volume #n for `archive' and hit return:
When prompting for a new tape,taraccepts any of the following responses:
- !
- Request
tarto run a subshell. This option can be disabled by giving ‘--restrict’ command line option totar(24).
So if we can force the end of a tape prematurely, tar will allow us to drop to a prompt. Turns out a few lesser used options provide just that ability. Here's an example script that will drop to yet another shell. Check it yourself with 'ps f' afterwards.
#!/bin/sh
dd if=/dev/zero of=./filler bs=1024 count=30
echo "at the next prompt, enter '!' without the quotes and press Enter"
tar cf /tmp/tmp.tar --multi-volume --tape-length=10 ./filler
No comments:
Post a Comment