Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    How do I create a directory in every home dir?

    I've got a Linux mail server running with about 100 users. I'm adding some Anti-Spam software and I want to have it put the spam into a subfolder of the Maildir folder in each user's home directory. Now I've implemented this in my own account and it works fine. My questions now is how can I add this Spam folder to every existing user's homedir with correct ownership and write permissions? I've already added it to the /etc/skel folder but that won't help my existing users.

  2. #2
    Just Joined! adamdaughterson's Avatar
    Join Date
    Mar 2003
    Denver, Colorado, USA
    Try something like this:

    for  home in `awk -F: '{print $6}' /etc/passwd`
       [ -d "$home" ] || continue
       [ -r "$home" ] || continue
       (cd $home; tar xvf archive_to_deploy_to_users.tar)
    exit 0
    I use something similar to convert a bunch of .wav files in an arbitrary directory to .flac.
    Adam Daughterson

  3. #3
    Thanx. That worked.

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts