Creating a bogus directory

Ben Stringer ben at burbong.com
Wed Jan 21 04:03:10 UTC 2004


On Wed, 2004-01-21 at 14:34, dalen wrote:

> Mike,
>     I would delete the mkdir lines as they only need to be run once, 
> while the rsync lines need to run often.  If you run mkdir twice it 
> gives a similar error... 
> 
> [root at viewlib root]# mkdir /root/m
> [root at viewlib root]# mkdir /root/m
> mkdir: cannot create directory `/root/m': File exists
> [root at viewlib root]#
> 
> You could also wrap a mkdir command in some "if dir doesn't exist" code.

"mkdir -p" will work well here - creates parent directories if they
don't exist, no error if they do.

Cheers, Ben






More information about the fedora-list mailing list