Re: Bit bucket directory
- From: Logan Shaw <lshaw-usenet@xxxxxxxxxxxxx>
- Date: Sun, 27 Apr 2008 11:20:10 -0500
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
.
- References:
- Bit bucket directory
- From: Noob
- Bit bucket directory
- Prev by Date: Re: /dev/urandom too slow on my system
- Next by Date: http server lib?
- Previous by thread: Re: Bit bucket directory
- Next by thread: linux timer wheels
- Index(es):