rdiff-backup-users
[Top][All Lists]
Advanced

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

Re: [rdiff-backup-users] rdiff-backup follows symbolic links to other fi


From: David
Subject: Re: [rdiff-backup-users] rdiff-backup follows symbolic links to other filesystems with --exclude-other-filesystems enabled
Date: Fri, 7 Sep 2007 08:43:05 +0200

> ls -l /media/rdiff_backup/symlink_dir/
>
> instead of
>
> ls -l /media/rdiff_backup/symlink_dir
>
> The first dereferences the symlink and shows the contents of the
> symlinked directory.  The second shows the symlink without following it.
>  What surprises me a little now is that:
>
> ls -ld /media/rdiff_backup/symlink_dir/

The difference between symlink and symlink/ is unix related, not
tool-specific. ie it wasn't added as a special case into rdiff-backup
(as far as I know).

Essentially the difference is:

/dir/symlink refers to the file "symlink" under /dir/, while
/dir/symlink/ refers to the directory linked to by "symlink".

This is handled by unix internals. ie, all tools use something like
open(path), and get back a file handle. The parsing of the path and
how to follow symlinks etc to get to the destination is handled by
unix, not each individual app.

One way to think of it is that regular files, symlinks,
subdirectories, device nodes, hard links, etc are all "files"
belonging to their parent directory. While the meaning of  /dir/subdir
and /dir/subdir/ is clear to the linux internels (they both point to
the same device inode), the difference between /dir/symlink and
/dir/symlink/ is not as clear.

Basically the / after "symlink" tells unix to "look up the directory
destination of the symlink", rather than "refer to the symlink
itself".

Here's another example:

ls -ld /dir/symlink/subdir

Would you expect the above command to not look under
/dir/symlink/subdir/ because /dir/symlink is a symlink?

This is why ls -ld and rdiff-backup have this same behavior.

Dvid.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]