If there are files that are being used by a process and are deleted by mistake, they can be recovered. If no process is using it, the accidentally deleted files cannot be recovered. If the /var/log/messages file is deleted by mistake: 1. Query the process that is using the file. [root@www]# lsof |grep message rsyslogd 1717 root 1w REG 8,2 243321 654968 /var/log/messages 2. According to the query results, the process with PID 1717 is using the file. Enter the directory /proc/1717/fd under the process /proc: [root@www fd]#ll total 0 lrwx------ 1 root root 64 Jan 10 14:34 0 -> socket:[11015] l-wx------ 1 root root 64 Jan 10 14:34 1 -> /var/log/messages l-wx------ 1 root root 64 Jan 10 14:34 2 -> /var/log/secure lr-x------ 1 root root 64 Jan 10 14:34 3 -> /proc/kmsg l-wx------ 1 root root 64 Jan 10 14:34 4 -> /var/log/maillog l-wx------ 1 root root 64 Jan 10 14:34 5 -> /var/log/cron 3. Query file 1, which corresponds to the messages log. Use cat 1 > /var/log/messages to copy it back, and then restart the syslogd service. Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Detailed explanation of data transmission between React parent components and child components
>>: Sharing of SQL optimization experience when offset is too large during MySQL paging
Configure multiple servers in nginx.conf: When pr...
Table of contents Mixins implementation Hook func...
Prepare the database (MySQL). If you already have...
Table of contents 1.DB,DBMS,SQL 2. Characteristic...
When people are working on a backend management s...
To view the version and tag of the image, you nee...
Let's try out nginx's reverse proxy here....
1. Download the 64-bit zip file from the official...
Table of contents Class Component Functional Comp...
Recently, I have a need to list all host names in...
There are two situations 1. Start time and end ti...
<br />In HTML language, you can automaticall...
1. Use of CSS scope (style division) In Vue, make...
Basics In a relational database, each data table ...
This article mainly introduces how to add floatin...