Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Mar 2001 13:55:54 -0600 (CST)
From:      Scott Pilz <tech@squid.tznet.com>
To:        freebsd-questions@freebsd.org
Subject:   Code Question
Message-ID:  <Pine.BSF.4.05.10103011351010.18138-100000@squid.tznet.com>

next in thread | raw e-mail | index | archive | help
With the number of intelligent people on this list (and some very
accomplished coders) I thought that I would give this a go. 

For those of you familer with /var/mail/$user
And hash spool 2, /var/mail/u/s/user

This will be more obvious as to what I'm looking to do, other than that,
try to follow the example, and thank you all for your replys.

I'm looking for a program, shell, perl, you name it, that will do this
much for me ...

Take every file in /foo (such as /foo/apple /foo/peach /foo/orange),
extract the first two characters, and then move them to a desired location
by those two character matches.

Example:

/var/mail currently has 8k files, as well as directories a-z, 0-9. And
those directories (a-z and 0-9) have there own directories (a-z and 0-9)..
So, you have this:

/var/mail/a/b
/var/mail/a/c
/var/mail/a/d

and so on.

Now lets say you have /var/mail/apple as a file.

I need a script that will move /var/mail/* to: 

/var/mail/<first chracter>/<second character>/<file>

/var/mail/apple ->  /var/mail/a/p/apple

The reasoning for this is simple. 

We have a mail server that we have been using without hash spool (qpopper
pop3, sendmail smtp, procmail is the delivery agent). We want to use hash
spool 2 to speed up things.

I realize this may sound confusing, feel free to respond with any
questions, and thanks again!

-Scott


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10103011351010.18138-100000>