Answer the question
In order to leave comments, you need to log in
`
How to treat the error "mkdir: cannot create directory `/home/domen.ru/log': File exists"?
Skill: Very Beginner
What we do: VPS
OS: centos-6-x86_64
When installing LAMP + Nginx, there was a problem, after creating users, they repeat domain names for me. It's time to create directories and the problem is out. First, after executing the script:
cd /home
for dir in `ls -1 `; do
mkdir /home/$dir/log
mkdir /home/$dir/html
chown -R $dir:apache $dir
chmod ug+rX $dir
done;
mkdir: cannot create directory `/home/domen.ru/log': File exists
mkdir: cannot create directory `/home/domen.ru/html': File exists
mkdir: cannot create directory `/home/domen2.ru/log': File exists
mkdir: cannot create directory `/home/domen2.ru/html': File exists
mkdir /home/domen.ru/log
mkdir: cannot create directory `/home/domen.ru/log': File exists
Answer the question
In order to leave comments, you need to log in
Yes, excuse me, there was a mistake in writing and understanding, in general, the script became working for my VPS:
cd /home
for dir in `ls -1 `; do
mkdir -p /home/$dir/log
mkdir -p /home/$dir/html
chown -R $dir:apache $dir
chmod ug+rX $dir
done;
cd /home
for dir in `ls -1 `; do
mkdir -p /home/$dir/{html,log}
chown -R $dir:apache $dir
chmod ug+rX $dir
done;
mkdir -p /home/$dir/{html,log}
You want to go to the /home/domen.ru/log directory, but you are trying to go to the /domen.ru/log directory
Solved, stackoverflow helped:
cd /home
for dir in `ls -1 `; do
mkdir -p /home/$dir/log
mkdir -p /home/$dir/html
chown -R $dir:apache $dir
chmod ug+rX $dir
done;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question