procmail
[Top] [All Lists]

Re: Why is softlink / hardlink "BOGUS" ?

1996-05-26 02:48:53
"Jan" == Jan Vicherek <honza(_at_)ied(_dot_)com> writes:

    Jan> If /var/spool/mail/$LOGNAME is a bogus mailbox (i.e. does not
    Jan> belong to the recipient, is unwritable, is a symbolic link or
    Jan> is a hard link), procmail will upon startup try to rename it
    Jan> into a file starting with `BOGUS.'

I dunno what system you're running (looks like Linux from the
message-id), but on Unix systems *all* regular files appear in the
directory as hard links.  All hard links are the same, that is, there
is not a "file" and a "hard link", there are two hard links to the
file.  What the man page must mean is that if the inode's ref count is
greater than 1, the mailbox is identified as bogus.  Symbolic links
are asymmetric, which is the file and which the symbolic link is easy
to identify.  However, without a search you cannot identify other hard 
or sym links to a given file.

    Jan>   Why can't I have a hardlink ?

    Jan>   Why can't I have a softlink ?

I would have thought security reasons; procmail can't know who the
other links belong to.  But at least on my system, it is the file that
has permissions, not the link, so all links to a given file have the
same owner, group, and permissions.  There must be some reason ;-)

    Jan>  I have run into the following problem :

    Jan>  When I was doing backup, first I made copy of the tree using
    Jan> "cp -al", because I wanted to delete from this "tree" files
    Jan> that I didn't want to have backed up, and leave the ones I
    Jan> wanted to have backed up.  (cp -al copies trees using
    Jan> hardlinks)

    Jan>       But !

    Jan>  When I was doing this, I noticed that my mailbox shrunk to
    Jan> zero ! (as pine told me). After a while I found out that
    Jan> procmail was causing it.

Get GNU cp (if you've got Linux, that's what you're using anyway) and
use cp -pRs (-as doesn't make sense, since -d doesn't make sense here,
but it probably would work too).  procmail can't identify a file that
is the *target* of a symlink, unless it searches the whole file system
(including devices that may not be currently mounted :-).  I would
guess that space usage will be less than double that for the cp -ls
method, but I'm not a file system hacker.

I haven't tried this, but it should work.

I should think there are more efficient ways to do the kind of partial 
backup you're talking about though....

-- 
                           Stephen John Turnbull
University of Tsukuba                                        Yaseppochi-Gumi
Institute of Policy and Planning Sciences  http://turnbull.sk.tsukuba.ac.jp/
Tennodai 1-1-1, Tsukuba, 305 JAPAN                 
turnbull(_at_)sk(_dot_)tsukuba(_dot_)ac(_dot_)jp

<Prev in Thread] Current Thread [Next in Thread>