Any problems with moving a sites directory and linking to it?

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
I have a second hard drive, and rather than use a home2 partition for WHM to automatically use, I have all accounts created in /home and move specific ones to the other drive, then symlink to them.

I create domainx.com at /home/usernamx, then I move the usernamx directory to a directory on the 2nd drive, /mysites/domainx.com, then symlink the new location to where it is expected to be. ln -s /mysites/domainx.com /home/usernamx

The sites directory appears to be at /home/usernamx, but is physically located on a different drive, and in a directory easily recognizable.

I did this a couple months ago with a test site and appears to have no problems. The site works. Email accounts work. Scripts that require the full path work using /home/usernamx/public_html/path/to/script. Testing shows that nothing appears to be affected by the symbolic link, so I'm going to move a few of my sites to the 2nd drive this way.

Question is:
Are there any problems with moving a sites directory and linking to it that I may not have found yet?

Another way to word it is:
Is there any function that can be affected by the directory not physically being where it's supposed to be?
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
The only thing I can think of is cPanel backups - do they backup the symlinked directory or just the symlink file? ;)
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
Backup doesn't follow symbolic links, but that isn't a possible problem because I use my own backup script. That's one of the reasons I'm doing this. ;)

My script backs up the home directory daily, and will be backing up my other directory weekly, but the mail folders in it will be hourly.