1

I cannot categorize this question under ubuntu since it has nothing to do with it. But I know people here can definitely answer this. I login to one of my deployment boxes using SSH (no ubuntu here).

I am working in a tool called TeamCity which uses a folder called ".BuildServer" under home directory of the user. This folder may grow in size as the application runs but the current user is only given a limited amount of space. But the good thing this I got a folder access outside /home/deploy (deploy being the user here) folder. I now want to link this .BuildServer inside the /home/deploy directory to the other folder where I got permission for (meaning all the files should be re-routed to that directory)

Hope my question was clear, please help.

2
  • WHat have you tried already? I've not fully understood your question, do you want to move /home/user/.BuildServer to /home/deploy, and create the symlink /home/user/.BuildServer pointing to /home/deploy?
    – Lekensteyn
    Jan 13, 2011 at 20:19
  • "deploy" is the username. So user and deploy are both the same. My sys admin has created a folder under root and has given me privileges to use it. I now want to re-route this /home/deploy/.BuildServer to that folder under root to /under_root/somfolder
    – bragboy
    Jan 13, 2011 at 20:22

1 Answer 1

2

You've multiple options if you want to point /home/deploy/.BuildServer to an other directory, /under_root/somefolder/.

1) Create a symlink

ln -s /under_root/somefolder/ /home/deploy/.BuildServer

You should remove the .BuildServer directory first. Alternatively, you can move the .BuildServer directory to the new location:

mv /home/deploy/.BuildServer/ /under_root/somefolder/

Now run the ln command (see above). Note: the user accessing /under_root/somefolder/ should have access to that folder. Say the user is deploy, somefolder is owned by deploy, but /under_root is owned by some other user. You've now two possibilities: let deploy be a member of the group, used for /under_root and give add the execute bit to the group. (chmod g+x /under_root). The other case is that deploy cannot have the groupship over /under_root. In that case, make sure that anybody can dive in the directory: chmod o+x /under_root). This has to be done for every folder "above" /under_root/somefolder.

2) Bind mount

This can only be done by a user with root permissions (ask your sysadmin).

mount --bind /under_root/somefolder /home/deploy/.BuildServer

Using this method, there is no need to mess with the permissions of /under_root. Another advantage over symlinks is that this method works even if ssh chroots to /home/deploy.

1
  • +1 Recipe assuming admins got the permissions correctly: 'mv /home/deploy/.BuildServer /under_root/somefolder; ln -s /under_root/somefolder /home/deploy/.BuildServer'
    – user8290
    Jan 13, 2011 at 23:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .