In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
If there is a file in use by the process, if it is deleted by mistake, it can be recovered. If no process is in use, you will not be able to retrieve the file that was deleted by mistake.
If the / var/log/messages file is deleted by mistake:
1. Query the process that is using the file.
[root@www] # lsof | grep messagersyslogd 1717 root 1w REG 8 243321 654968 / var/log/messages
two。 According to the query results, the file is being used by a process with a PID of 1717. Enter the directory / proc/1717/fd under the process / proc:
[root@www fd] # lltotal 0lrwx-1 root root 64 Jan 10 14:34 0-> socket: [11015] lmurwx-1 root root 64 Jan 10 14:34 1-> / var/log/messagesl-wx- 1 root root 64 Jan 10 14:34 2-> / var/log/securelr-x- 1 root root 64 Jan 10 14:34 3-> / proc/kmsgl-wx- 1 root root 64 Jan 10 14:34 4-> / var/log/maillogl-wx- 1 root root 64 Jan 10 14:34 5-> / var/log/cron
3. The query file 1 corresponds to the messages log. Copy it back using cat 1 > / var/log/messages, and then restart the syslogd service.
Summary
The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. Thank you for your support. If you want to know more about it, please see the relevant links below.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.