I was a little nervous when I was managing the server It's really embarrassing and ridiculous, but I wrote an article as a commandment to myself.
TLDL;
—— Obviously, use `` (backticks)
properly when sending code snippets and commands over chat. Otherwise, the symbol will be recognized as Markdown and it may be difficult. * Depending on the notation, ~ (tilde)
is OK
――It is natural, but let's check the contents of the OS command to be executed before executing it.
――It's natural, but let's do log rotation
The Jira server used in the department did not start, so we investigated the cause with two people The bloated Jira log files were eating up storage.
So, looking at the log contents of Jira, the log rotation is not solid The file was not compressed or deleted.
ls result
[root@jira ~]# ls -ahl /opt/atlassian/jira/logs/
total 59G
drwx------ 2 jira root 68K Jan 24 03:45 .
drwxr-xr-x 15 root root 4.0K Feb 25 2016 ..
-rw-r--r-- 1 jira jira 1.2K Jul 1 2019 catalina.2019-07-01.log
-rw-r--r-- 1 jira jira 3.8K Jul 2 2019 catalina.2019-07-02.log
-rw-r--r-- 1 jira jira 1.5K Jul 5 2019 catalina.2019-07-05.log
-rw-r--r-- 1 jira jira 1.5K Jul 5 2019 catalina.2019-07-05.log
-rw-r--r-- 1 jira jira 0 Jan 24 03:45 catalina.out
Therefore
Decided to do.
I was surprised when I took action in 1.
The command I wanted to type
[root@jira ~]# find /opt/atlassian/jira/logs/*.*.* -mtime +30 | xargs rm
Created 30 days ago under / opt / atlassian / jira / logs / (strictly modified)
Deleted *. *. * (E.g. catalina.2019-07-05.log etc.)
.
The member I was working with wrote a command to delete the target file in chat and sent it to me.
It was.
I noticed before typing the command, but if I type it as it is, it will blow away the upper directory of / opt / atlassian / jira / logs /
and it will be a big deal ...
On chat
find /opt/atlassian/jira/logs/*.*.* -mtime +30 | xargs rm
When you hit, the *. *
Part of the first half of *. *. *
Is Markdown's [emphasis](https://qiita.com/tbpgr/items/989c6badefff69377da7#-%E5%BC%B7%E8 % AA% BFem) was judged and it was italicized.
However,
Normal dot | Italic dots |
---|---|
. | . |
Hmm? ?? Looking for a mistake? ??
I don't know if the dots are italic by looking at the putt.
It was good because I saw the command properly, but what happened if my brain died and I was playing the command ...
Codes and commands have various symbols that are also used in Markdown.
In a scene where you can quickly send code snippets and commands on chat
Firmly, if you don't use `` (backticks)
`, it may be difficult in the future.
I realized it.
~ (tilde)
.Recommended Posts