Tag Info

Hot answers tagged

58

A hard link traditionally shares the same file system structures (inode in unixspeak), while a soft-link is a pathname redirect. Hardlinks must be on the same filesystem, softlinks can cross filesystems. Hardlinked files stay linked even if you move either of them (unless you move one to another file system triggering the copy-and-delete mechanism). ...


13

You can store symlinks as symlinks (as opposed to a copy of the file/directory they point to) using the --symlinks parameter of the standard zip. Assuming foo is a directory containing symlinks: zip --symlinks -r foo.zip foo/ Rar equivalent: rar a -ol foo.rar foo/ tar stores them as is by default. tar czpvf foo.tgz foo/ Note that the symlink ...


12

Symlinks are purely symbolic: they contain nothing but a path, so when you open a symlink, the OS reads the path and uses that instead. In a chroot environment, links (especially ones with absolute paths) typically don't point to the same place they pointed to in the normal environment. If the server OS is Linux, your best bet is to bind-mount the entire ...


9

The summary is that a symbolic / short link acts as a shortcut to the first file's location, whereas a hardlink is a shortcut to the file on the disk. If you delete the target of a soft link then the soft link will cease to work, but if you delete one copy of a hard link, the file will remain on the disk until all hard links to it are removed. In effect all ...


8

You should be able to use pwd -P tony@matrix:/var/vhosts$ pwd /var/vhosts tony@matrix:/var/vhosts$ pwd -P /srv/data/vhosts


8

I don't think you will find a more feature-rich and well-documented utility/add-on than Hermann Schinagl's Link Shell Extensions found here: http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html Truly everthing else that I have read and used pales by comparison.


7

I had a very similar problem. Like you, I was unable to follow symlinks under my home directory even though I had the FollowSymlinks enabled plus I could ls around with my http user, but putting symlinks under /srv/http worked just fine... I fixed it by chmod'ing my home directory to be executable: chmod +x /home/mgalgs And that did it for me! Maybe try ...


6

From the chcon(1) man page: -h, --no-dereference affect symbolic links instead of any referenced file


6

May I answer with a question? Assuming you're on a RedHat/CentOS install here... ls /etc/httpd/ # should return something like: # conf conf.d logs modules run cd /etc/httpd/logs/ # Why does this next command fail? ls ../conf # ls: cannot access ../conf: No such file or directory # But this next command works? cd ../conf The short answer is ...


5

I noticed you add git as a tag--it sounds like /home/ubuntu/etc-config is a git repository with all your configs in it. In which case, it sounds like you're trying to manage configuration files from a central location. If that's the case, I highly recommend looking for a real solution. Take a look at something like puppet, chef, cfengine, or any of the ...


5

You can't, there is only 1 directory. You need to unlink the folder and link just the files or subfolders apart from the one that needs to be different.


5

A small note, is that you could use ln both times to make the command not actually move the data (assuming both paths are on the same filesystem). ln /some/path/file /another/path/ && ln -sf /another/path/file /some/path/ But I assume that you want to move the content of /some/path/ to an other disk, and then create links to the new files so "no ...


4

I don't think that there is a FTP daemon which can circumvent the chroot(2) syscall. And if there was such a daemon, I wouldn't use it because it opens a lot of security holes. What's the point chrooting the users anyway if you want them to access the whole file system (through manipulated symbolic links)?


4

Unfortunately no. All information about a symlink is stored within the symlink itself, therefore it's impossible to find without scanning the entire filesystem.


4

I'm not with Rackspace, but having worked for a hosting provider I can give you one general piece of advice: If your provider says something to the effect of "We can't guarantee that X will work" and you elect to do it anyway you are outside of anyone's ability to support you. If it works, "Hey that's great! We're really happy for you!" If it stops ...


4

. indicates the current directory. Once you CD to a symlink, you are in the destination directory. What you are seeing is not an error, or a problem of any kind. This is how symlinks work in unix systems. If you want to see the symlink when you list files, then stay in the parent directory where the actual symlink exists.


4

While it doesn't keep them separate, etckeeper does a very good job of tracking changes to config files. Keeping the repository off of the box somewhere would make it easy to restore those changes to a new machine.


4

From the Apache 2 documentation, For security reasons, Apache will follow symbolic links only if the Options setting for the relevant directory includes FollowSymLinks or SymLinksIfOwnerMatch. So you need to make sure you have FollowSymLinks in the Options setting, probably as part of the <Directory> container. For example, <Directory ...


4

That's not how symbolic links work. (So the answer to your question is "No", at least not with symbolic links.) What you are looking for is called a Union Mount - I'm not aware of any way to accomplish this on Windows, though it may be possible and I've just never seen it...


3

I generally will setup something like this. /var/www/version1 /var/www/version2 /var/www/production (document root, symlink -> current version) So basically you just upload to a new directory, once the upload is complete tweak your symlink and everything changes at once. When applications are designed in a way to separate code from the application ...


3

If you are really worried about the performance issue (minimal) of a symlink, then you could always use a bind mount instead. You also, will not have any of the security implications either. A bind-mount is basically a symlink that exists purely at the kernel level. But you probably shouldn't really be worrying about the performance aspect unless you ...


3

The permission of the link has no effect for the target, what you are trying to do is not restricting permission on the target at all. Only the permission of the target is what has effect. Quoting http://en.wikipedia.org/wiki/Symbolic_link: The file system permissions of a symbolic link usually have relevance only to rename or removal operations of ...


3

If these are on different filesystems, then this is a very bad idea. If the other filesystem does not mount then you will have problems.


3

No, this is not possible with a single NFS export on kernel based nfs server. As exports(5) manual says: The file /etc/exports contains a table of local physical file systems on an NFS server that are accessible to NFS clients. However you can export parts of the tree and reassemble them on the clients with bind. Symbolic links Another palliative ...


3

No, I have never had problems doing that, and I done that on many machines. If for some reason you didn't want to use a symlink then you could just do a bind mount.


3

An alias contains two pieces of information: a unique identifier of the file it links to, and the path and file name of the file it links to. If you rename or move a file, and then create a new file with the path and file name that the file originally had, then any alias that linked to the original file now links to the new file. However, if you rename or ...


3

Yes, that's a symbolic link. The reason you're unable to create one is you're using the wrong syntax: you're using ls instead of ln, and also ln wants the name of the existing file (or directory) as its first parameter, and the name of the symbolic link to create as the second one. In your case, the right command would be ln -s /storage/thumbs thumbs.


3

Is SELinux enabled on this server? I wonder if this is stopping apache from loading this symlink correctly?


3

NTFS Link provides an explorer extension for creating hard links.


3

I think what you want here, is to bind mount the target directory inside the jail of the user. You can't symlink out of a jail. Look at this, for instance: mount --bind /media/sdb2/mydocs/archive /home/username/archive



Only top voted, non community-wiki answers of a minimum length are eligible