linuxgitunixterminalsymlink

symlink from public_html_source to public_html


i'm trying to create a symlink between 2 folders on a server that has limited access so I can "deploy" my site.

This is the path to the git repo /home2/username/public_html_source and in there there is a folder named backend_code Instead of ftp uploading the files of backend_code into /home2/username/public_html, I would like to make a link to it.

I tried using ln but I keep getting a symlink folder inside of public_html.

So i'm trying to get /home2/username/public_html

to point to /home2/username/public_html_source/backend_code


Solution

  • First move the /home2/username/public_html folder somewhere else.

    mv /home2/username/public_html /home2/username/public_html_old
    

    Then apply

    ln -s /home2/username/public_html_source/backend_code /home2/username/public_html