Re: help with cp or mkdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Skull Crusher writes....
> 
> I have tried what you have suggested and I get almost the same result.
> Except no errors just just to the prompt and no NEW public_html
> directories
> I apologize that I did not send along the error message
> I have setup up so new users will get public_html when the account is
> made.
> 
> Joe..
> 
> 
> *> I thought that would do it but for some reason it does not. Just
> gives
> *> me a bunch of errors saying mkdir: cannot create directory
> *> `/home/a/username/public_html': File exists
> *> But it doesn't and it didn't not make it
> 
> *well, this means that (at least for some of the users) this dir already
> *exists.  Are there also some user directories which you plan to create
> in
> *this step?  then you have to issue
> *
> *mkdir -p /home/*/*/public_html
> *
> *Also, in future please post the original error message, or do you have
> a
> *user "username"?
> *
> *Cheers,
> *
> *Michael
> *

Create the following script (below).  The #! /bin/sh sould be the first
line.   Make the file executable with   'chmod 700 filename'
then run it.      ./filename
Look at the output and make sure all of the "Creating......."
lines look correct.  If not, you might have to tweek the script.
When it looks right, uncomment the mkdir line and run it again.
Worse case senario is you might create a public_html where you didn't
want on.  If it's just a few, delete them manually.  (Beats creating
200+ manually.)  Or if the file already exists, or path doesn't
exist, you might get some error.  No big deal.

-- Jay Crews
jpc@xxxxxxxxxxxx



#! /bin/sh
#
#
for dir in `grep '/home/[a-z]/' /etc/passwd | cut -d: -f6` ;do
  echo Creating ${dir}/public_html
  # mkdir ${dir}/public_html
done



-- 
Psyche-list mailing list
Psyche-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/psyche-list

[Index of Archives]     [Fedora General Discussion]     [Red Hat General Discussion]     [Centos]     [Kernel]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat 9]     [Gimp]     [Yosemite News]

  Powered by Linux