Consider an example in which you want to symbolize application logs elsewhere, which may be a directory that is mounted on a secondary directory whose size will not cause your server to stop working. Now the installed directory will be your target, and you must create a symbolic link for this directory for your log directory.
Suppose your application directory is / home / ubuntu / my _app, and as soon as you start the application, it will create a log directory inside your my_app directory. Now the ultimate goal is to divert the load of disk usage to the mounted directory and currently there is no our log directory present in our application directory. So just follow these steps:
mkdir /path_to_mounted_directory/log ln -s /path_to_mounted_directory/log /home/ubuntu/my_app_log
First, a directory will be created called log in installed section and will map your application logs to this directory. Any file that you add to the applicationโs log folder will be automatically linked to the mounted directory, and you can read these files anywhere, either from the original log directory or from the mounted folder.
source share