On Thu, 18 Oct 2001 at 23:01, dwen wrote:
> > If you don't need to convert existing mboxes, just create one generic
> > Maildir using maildirmake, copy this to every home directory you have,
> > then change their ownerships and permissions.
>
> That's what i wanted to do(using a script) I wont bother doing it
> manually to a 2k plus users.

You didn't get my point, did you? Or can you get points at all? Sheesh.

You only make the maildir ONCE. They're generic. Have you ever looked at a
"blank" Maildir? The structure is like this (all directories):

./Maildir
./Maildir/cur/
./Maildir/new/
./Maildir/tmp/

That's all to it. Actually, you don't need maildirmake at all. You can
just mkdir these directories.

And the only real issue with that you have 2000 plus users is that it will
take time. It matters less whether you use Perl or what have you, because
you're not doing string manipulation (where Perl is excellent).

I would use Bash. Because it's just like me doing it except I can use
nested for loops to do the repetition.

Given a tree of home directories:

/home/a/alcazar
/home/a/...
/home/b/...
/home/.../...

Where the triple dots mean it goes something like the first.

-----[ START OF SCRIPT ]-----
#!/bin/bash

cd /home

for i in *; do cd "$i"; for j in *; do cd "$j"; mkdir Maildir; cd Maildir;
mkdir cur; mkdir new; mkdir tmp; cd ../..; chown "$j"."$j"  "$j" -R;
chmod u=rwX,g=,o= "$j" -R; done; cd ..; done;
-----[ END OF SCRIPT ]-----

What does this do?

Figure it out.

If you can't figure it out:

It goes to /home, then for every directory it will enter that directory
(this is the "a", "b", ...) then for every directory in that (the actual
home directories) will enter, create Maildir, enter that Maildir, create
cur, new and tmp, leave the Maildir and the home directory, fix ownership
and permissions, exit again, and proceed with the next.

Dwen, if you're handling systems with 2k plus users, I recommend you learn
how to start reading manpages and searching websites instead of crying and
expecting people like me to do your work for you (which I just did now).

Sheesh.

 --> Jijo

--
Federico Sevilla III  :: [EMAIL PROTECTED]
Network Administrator :: The Leather Collection, Inc.
GnuPG Key: <http://jijo.leathercollection.ph/jijo.gpg>

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to