Re: Bit bucket directory



Noob wrote:
Is there a way to have a "black hole" directory, like /dev/null is a "black hole" file.

Let's call such a directory /dev/nulldir. Anything written to nulldir would disappear, and return success.

Background : I want to scp multiple large files to a remote system that has very limited disk space. (I'm testing scp behavior.)

Depending on what it is about scp behavior you're testing, how about
creating a mirror image of the directory hierarchy, but with smaller
files?

Something like this:

cd /bigdir
mkdir /tmp/smalldir
find . -depth -type d -print | ( cd /tmp/smalldir && cpio -pdmv )
find . -type f -print | while read f
do
dd if="$f" of=/tmp/smalldir/"$f" bs=512 count=1
done

Now you should have a similar directory hierarchy but with only the
first 512 bytes of the original files. It won't be an exact mirror
because the file ownership will be different, but that might be good
enough.

- Logan
.