Creating a bogus directory

dalen dalen at czexan.net
Wed Jan 21 03:34:50 UTC 2004


MJ WESTKAMPER wrote:

>I am running the following script, mkrepository, to create a local yum
>repository.
>I have applied the latest updates.
>I am running the smp kernel .2149 on a 2 x 1.0 Ghz Genuine intel system
>known to work with MS Win2k adn RH9 without problems.
>
>==============================
>#!/bin/bash
>
>mkdir /home/mirror
>mkdir /home/mirror/yum-repository
>mkdir /home/mirror/yum-repository/fedora
>mkdir /home/mirror/yum-repository/fedora/base
>mkdir /home/mirror/yum-repository/fedora/updates
>
>/usr/bin/rsync --verbose --progress --stats --archive --partial --exclude
>SRPMS/ --exclude dosutils/ --exclude images/ --exclude isolinux/
>mirrors.kernel.org::fedora/core/1/i386/os/
>/home/mirror/yum-repository/fedora/base/
>
>/usr/bin/rsync --verbose --progress --stats --archive --delete --exclude
>debug/ --exclude SRPMS/ --partial
>mirrors.kernel.org::fedora/core/updates/1/i386/
>/home/mirror/yum-repository/fedora/updates/
>
>==============================
>
>The results are below - Please note the problem is noted at the mkdir in
>line 1 - the file /r does not exist.
>
>==============================
>[root at TestServer home]# ./mkrepository
>mkdir: cannot create directory `\r': File exists
>MOTD:
>MOTD:   Welcome to the Linux Kernel Archive.
>MOTD:
>MOTD:   Due to U.S. Exports Regulations, all cryptographic software on this
>MOTD:   site is subject to the following legal notice:
>MOTD:
>MOTD:   This site includes publicly available encryption source code
>MOTD:   which, together with object code resulting from the compiling of
>MOTD:   publicly available source code, may be exported from the United
>MOTD:   States under License Exception "TSU" pursuant to 15 C.F.R. Section
>MOTD:   740.13(e).
>MOTD:
>MOTD:   This legal notice applies to cryptographic software only.
>MOTD:   Please see the Bureau of Industry and Security,
>MOTD:   http://www.bis.doc.gov/ for more information about current
>MOTD:   U.S. regulations.
>MOTD:
>
>receiving file list ...
>3835 files to consider
>created directory /home/mirror/yum-repository/fedora/base/
>./
>Fedora/
>Fedora/RPMS/
>Fedora/RPMS/4Suite-1.0-0.0.a3.i386.rpm
>Fedora/base/
>SRPMS -> ../../SRPMS
>headers/
>
>(The process goes to completion)
>
>=================
>
>The file structure ends up looking like this:
>
>/home
>  ?                     ; A bogus directory - empty
>  mirror                ; correct
>    yum-repository      ; correct
>       fedora           ; correct
>          base          ; correct
>             ?          ; bogus directory - contains the contents
>transferred by rsync
>          update        ; correct
>             ?          ; bogus directory - contains the contents
>transferred by rsync
>
>The bogus directory has a label 0x000d. It is interperted as a /r by the
>command line processor and appears as a ? on ls.
>
>
>Any help would be appreciated.
>
>
>Mike
>
>
>  
>
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.

Thanks,

Dale







More information about the fedora-list mailing list