Store Tomcat's run log in the home partition via soft link ln-s

Source: Internet
Author: User

An Introduction

Links created using the ln command are divided into soft links and hard links:

    • Soft Link: "ln–s source file Destination file" will only generate a mirror image of a file in the selected location and will not occupy disk space, similar to Windows shortcuts

    • Hard link: "ln source file Destination file", without parameter-s, generates a file of the same size as the source file at the selected location

The link created by the LN command, whether it is a soft link or a hard link, will control the file synchronization changes

It is important to note that the Mount–bind command can also create links, unlike Ln-s, where theMount–bind is to mount a directory to another directory, which is equivalent to creating a hard link

two to store Tomcat's logs on the home partition

If one of our Tomcat is installed under the /usr/local/apache-tomcat-sso path and then the log file is stored in the /home/usr/sso/logs directory, we can use LN- s creates a shortcut under the Tomcat path, the real path to the log file is/home/usr/sso/logs, and the command is as follows:

[Email protected] logs]# ln-s/home/usr/sso/logs/usr/local/apache-tomcat-sso[[email protected] logs]# ls-l/usr/local /apache-tomcat-sso

After creating a soft link, the effect is as follows:

Total 88
Drwxr-xr-x. 2 root root 4096 May 6 14:21 bin
Drwxr-xr-x. 3 root root 4096 May 6 14:21 conf
Drwxr-xr-x. 2 root root 4096 May 6 14:21 Lib
-rw-r–r–. 1 root root 57862 May 6 14:21 LICENSE
lrwxrwxrwx. 1 root root 6 14:32 logs- /home/usr/sso/logs
Drwxr-xr-x. 2 root root 4096 May 6 14:21 Temp
Drwxr-xr-x. 7 root root 4096 May 6 14:21 WebApps
Drwxr-xr-x. 3 root root 4096 6 14:21 work


This article is from "Zifangsky's personal blog" blog, make sure to keep this source http://983836259.blog.51cto.com/7311475/1835382

Store Tomcat's run log in the home partition via soft link ln-s

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.