- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Create .elm directory in user home directory in ma...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 09:55 AM
05-13-2008 09:55 AM
Say there are 100 user directory's.
Say 30 already have the .elm directory.
I want to create for all the others.
Below is what user gets when first running elm and has to answer "y" to the 2 prompts.
I do not want users to see this.
Any help would be appreciated.
# elm
Notice:
This version of ELM requires the use of a .elm directory in your home
directory to store your elmrc and alias files. Shall I create the
directory .elm for you and set it up (y/n/q)? Yes.
Great! I'll do it now.
Notice:
ELM requires the use of a folders directory to store your mail folders in.
Shall I create the directory /home/agallajo/Mail for you (y/n/q) Yes.
Great! I'll do it now.
Solved! Go to Solution.
- Tags:
- ELM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 10:12 AM
05-13-2008 10:12 AM
Re: Create .elm directory in user home directory in mass
Normally 'elm' must be run interactively to setup its directories. However, you can simple do:
# mkdir .elm
# mkdir Mail
...within each user's home directory.
Regards!
...JRF...
- Tags:
- mkdir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 10:28 AM
05-13-2008 10:28 AM
Re: Create .elm directory in user home directory in mass
Any way to do make those 2 directory's in all users who do not have them?
I would like to be sure everyone has them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 10:36 AM
05-13-2008 10:36 AM
SolutionThis will automate the creation for you:
# cat ./mkelms
#!/usr/bin/sh
OLDIFS=${IFS}
IFS=":"
while read OWNER X UID X X DIR X
do
[ ${UID} -lt 100 ] && continue
[ -r ${DIR}/.elm ] || { mkdir ${DIR}/.elm; chown ${OWNER} ${DIR}/.elm; }
[ -r ${DIR}/Mail ] || { mkdir ${DIR}/Mail; chown ${OWNER} ${DIR}/Mail; }
done < /etc/passwd
IFS=${OLDIFS}
exit 0
...This uses '/etc/passwd' to deduce the correct HOME directory location of each user whose UID > 100 (the standard fence for "application" accounts). For every /home directory without an '.elm' or 'Mail' directory, one is created and the ownership set to that of the owner. It is assumed that 'root' will run this script.
Regards!
...JRF...
- Tags:
- passwd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 11:01 AM
05-13-2008 11:01 AM
Re: Create .elm directory in user home directory in mass
Thanks James!
Points awarded.
How would I ensure that the elm/Mail directories are created for every new user from now on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2008 11:46 AM
05-13-2008 11:46 AM
Re: Create .elm directory in user home directory in mass
> How would I ensure that the elm/Mail directories are created for every new user from now on?
If you, as the administrator, use 'useradd' to setup the account, you could craft a simple script that runs the 'useradd' followd by the necessary 'mkdir's.
See the manpages for 'useradd'. By example:
# ./mkuser
#!/usr/bin/sh
UID=$1
NAME=$2
GECOS=$3
useradd -u ${UID} -g 20 -s /usr/bin/sh -c "${GECOS}" -m ${NAME}
if [ $? -eq 0 ]; then
mkdir /home/${NAME}/.elm
chown ${NAME}:users /home/${NAME}/.elm
mkdir /home/${NAME}/Mail
chown ${NAME}:users /home/${NAME}/Mail
fi
exit 0
...run as:
# ./mkuser 2008 somebody "I am somebody"
Regards!
...JRF...
- Tags:
- useradd