CN104636242A - Method for automatically deleting repeated content in system logs on basis of Linux operating system - Google Patents

Method for automatically deleting repeated content in system logs on basis of Linux operating system Download PDF

Info

Publication number
CN104636242A
CN104636242A CN201510064528.XA CN201510064528A CN104636242A CN 104636242 A CN104636242 A CN 104636242A CN 201510064528 A CN201510064528 A CN 201510064528A CN 104636242 A CN104636242 A CN 104636242A
Authority
CN
China
Prior art keywords
automatically
linux
operating system
linux operating
suse
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201510064528.XA
Other languages
Chinese (zh)
Inventor
刘兢
任华进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Electronic Information Industry Co Ltd
Original Assignee
Inspur Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Electronic Information Industry Co Ltd filed Critical Inspur Electronic Information Industry Co Ltd
Priority to CN201510064528.XA priority Critical patent/CN104636242A/en
Publication of CN104636242A publication Critical patent/CN104636242A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for automatically deleting repeated content in system logs on the basis of a Linux operating system, belongs to the field of computer storage technology, and particularly relates to implementation of the function of automatically collecting information needed for machine failure exception problem analysis. According to the method, a system log collecting function is automatically triggered through a crontab tool under the Linux operating system, operation of compressing the sizes of log files is triggered automatically, and collected and processed information is automatically stored in appointed directories. Compared with the prior art, the method for automatically deleting the repeated content in the system logs on the basis of the Linux operating system has the advantages that in the aspect of usability, unattended operation can be achieved, system log information can be operated fully automatically and completely under the Linux operating system, the accuracy of failure analysis is improved, and application and popularization value is high.

Description

The method of duplicate contents is deleted in a kind of system journal based on (SuSE) Linux OS automatically
Technical field
The present invention relates to computer memory technical field, the method for duplicate contents is deleted in specifically a kind of system journal based on (SuSE) Linux OS automatically.
Background technology
Along with the development of the new techniques such as cloud computing, large data, people to server stable, reliably work to need sum-average arithmetic non-failure operation time (MTBF) to require more and more higher, how effectively shorten server failure repair time, the efficiency and the accuracy that improve fault analysis are the difficult problem of pendulum in face of each maintainer.
But, due to ceaselessly the work done at current system place can be write in/var/log/messages file in the operating system course of work, the information such as the state of hardware device feedback, when there are abnormal conditions in machine operation system or hardware device, the record of relevant information is just there will be in daily record, but operating system only can be loyal record these information, namely identical content is ceaselessly write in journal file, can't consider if the work that the duplicate contents write crosses multipair log analysis does not have help, the volume of journal file also can be caused excessive, finally occur that journal file is difficult to derive, be difficult to open reading, be difficult to the problem analyzed.
Summary of the invention
Technical assignment of the present invention is for above-mentioned the deficiencies in the prior art, a kind of system journal based on (SuSE) Linux OS is provided automatically to delete the method for duplicate contents, have automatic collector journal, automatic reduction operation system journal volume, unmanned such as to complete automatically at the feature.
Technical assignment of the present invention realizes in the following manner: the method for duplicate contents is deleted in a kind of system journal based on (SuSE) Linux OS automatically, be characterized in by the crontab instrument automatic trigger collection system journal function under (SuSE) Linux OS, the operation of automatic triggering compression journal file volume, and under automatically the information after having processed of collecting being saved in assigned catalogue, can ensure that whole operation is without the need to Attended mode.
In order to realize collecting the robotization of information process, can compile script program, by the shell script under (SuSE) Linux OS, start the process of whole collection information and process information.
In the crontab table of server OS, add fill order, after the time interval of system definition arrives, automatically will start the shell script calling automated processing system daily record, start the process processed.
The method and apparatus related in said method comprises: (1) (SuSE) Linux OS daily record; (2) uniq instrument; (3) crontab instrument.Wherein:
(1), (SuSE) Linux OS daily record: system journal is for security of system, extremely important, it have recorded the various things of system generation every day, and you can check the reason that mistake occurs or the vestige that time under attack, assailant stays by him.The main function of daily record has: audit and monitoring, monitoring system state that can also be real-time, monitoring and follow the trail of effractor etc.
(2), uniq instrument: the repeated rows in uniq order deleted file.The standard input or file of being specified by InFile parameter are read in uniq order.The row that this order is first more adjacent, then removes the follow-up copy of the second row and this row.
(3), crontab instrument: for arranging the instruction be periodically performed.This order from standard input device reading command, and is deposited in " crontab " file, for reading afterwards and performing.This word derives from Greek chronos (χ ρ ν ο), and original meaning is the time.The instruction that crontab stores is activated by finger daemon, and crond is usually at running background, and each minute checks whether that predetermined operation needs to perform.This kind of operation is commonly referred to as cron jobs.
Compared with prior art, the method that duplicate contents is deleted in the system journal based on (SuSE) Linux OS of the present invention automatically has following characteristics:
(1) can collector journal automatically, realize automatic reduction operation system journal volume, and unmanned completes automatically;
(2) utilize simple shell script to realize the process of whole collection information and process information, there is good versatility;
(3) only with under copying script file to corresponding operating system, just can complete unattended log collection and processing procedure after fill order, there is good ease for use, the accuracy of raising fault analysis.
Accompanying drawing explanation
Fig. 1 collects process journal file script and collection kit schematic diagram in embodiment;
Fig. 2 obtains journal file schematic diagram after embodiment executes automatic collection processing procedure.
Embodiment
With specific embodiment, the method that duplicate contents is deleted in the system journal based on (SuSE) Linux OS of the present invention is automatically described in detail below.
Embodiment:
The collection of the inventive method for server OS daily record and the processing procedure of reduced volume, the script file (as shown in Figure 1) that establishment is corresponding, the automatic process to system journal can be completed automatically, under file after having processed can be saved in the catalogue of specifying automatically, facilitate checking and deriving of follow-up maintenance personnel.
Owing to the addition of a fill order in the crontab table of server OS, after the time interval of system definition arrives, automatically the shell script calling automated processing system daily record will be started, start the process processed, order (editor's timing performs (every day performs once)) is as follows:
root@lc log]#crontab-u root-l
* * */1 * */var/log/log/logmaintenance.sh
[root@lc log]#
The preliminary work that collection process starts, under needing that collection and process daily record execution script program are placed into some catalogues of operating system, the script file needed under system is as follows:
[root@lc log]#ll
total 4
-rxrwxrwx.1 root root 94 Dec 13 10:52 logmaintenance.sh
[root@lc log]#
This catalogue is exactly later collection, processed after the file that the obtains position of depositing, check as Water demand information just directly can arrive this catalogue, ease for use of the present invention is embodied.
The shell script write in the inventive method, the implementing procedure needed in collection process can be called automatically, simultaneously when performing this shell script, log information after process can automatically be named according to the time automatically starting operation by program itself, and under being saved in the catalogue of specifying, though the version of (SuSE) Linux OS be 32 or 64 can this shell script general.
The message file sample finally collected as shown in Figure 2.

Claims (3)

1. the method for duplicate contents is deleted in the system journal based on (SuSE) Linux OS automatically, it is characterized in that: by the crontab instrument automatic trigger collection system journal function under (SuSE) Linux OS, the operation of automatic triggering compression journal file volume, and under automatically the information after having processed of collecting being saved in assigned catalogue.
2. the method for duplicate contents is deleted in the system journal based on (SuSE) Linux OS according to claim 1 automatically, it is characterized in that, by the shell script under (SuSE) Linux OS, starts the process of whole collection information and process information.
3. the method for duplicate contents is deleted in the system journal based on (SuSE) Linux OS according to claim 2 automatically, it is characterized in that, fill order is added, automatically to start the shell script calling automated processing system daily record in the crontab table of server OS.
CN201510064528.XA 2015-02-06 2015-02-06 Method for automatically deleting repeated content in system logs on basis of Linux operating system Pending CN104636242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510064528.XA CN104636242A (en) 2015-02-06 2015-02-06 Method for automatically deleting repeated content in system logs on basis of Linux operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510064528.XA CN104636242A (en) 2015-02-06 2015-02-06 Method for automatically deleting repeated content in system logs on basis of Linux operating system

Publications (1)

Publication Number Publication Date
CN104636242A true CN104636242A (en) 2015-05-20

Family

ID=53215027

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510064528.XA Pending CN104636242A (en) 2015-02-06 2015-02-06 Method for automatically deleting repeated content in system logs on basis of Linux operating system

Country Status (1)

Country Link
CN (1) CN104636242A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326082A (en) * 2015-06-16 2017-01-11 中兴通讯股份有限公司 Method and device for recording log in network system
CN106598832A (en) * 2015-10-16 2017-04-26 富士通株式会社 Device and method for processing running context of application in crowdsourcing test
CN107918565A (en) * 2017-11-17 2018-04-17 广东小天才科技有限公司 A kind of report method and mobile terminal of the exception information of application program
CN108829543A (en) * 2018-06-21 2018-11-16 郑州云海信息技术有限公司 A method of reducing backup Linux system log size
CN109062997A (en) * 2018-07-05 2018-12-21 中国电子科技集团公司第五十四研究所 A kind of automatic De-weight method of fence data
US10248658B2 (en) 2017-01-31 2019-04-02 International Business Machines Corporation Analytics and deduplication for air-gapped log analysis
CN113467407A (en) * 2021-09-06 2021-10-01 西安热工研究院有限公司 Fault information collection method, system and equipment for distributed control system
CN113849329A (en) * 2021-08-26 2021-12-28 苏州浪潮智能科技有限公司 Log analysis and integration method and system for operating system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970660A (en) * 2014-05-19 2014-08-06 浪潮电子信息产业股份有限公司 Total system stability automatic test method based on crontab
CN103995772A (en) * 2014-06-10 2014-08-20 浪潮电子信息产业股份有限公司 RAID card log completely-storing method based on LINUX operation system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103970660A (en) * 2014-05-19 2014-08-06 浪潮电子信息产业股份有限公司 Total system stability automatic test method based on crontab
CN103995772A (en) * 2014-06-10 2014-08-20 浪潮电子信息产业股份有限公司 RAID card log completely-storing method based on LINUX operation system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
RJFGOTO: "《百度文库》", 26 September 2014 *
陈素琴: "《Linux中的定时任务探讨》", 《现代计算机》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326082A (en) * 2015-06-16 2017-01-11 中兴通讯股份有限公司 Method and device for recording log in network system
CN106326082B (en) * 2015-06-16 2020-10-16 南京中兴新软件有限责任公司 Method and device for recording log in network system
CN106598832A (en) * 2015-10-16 2017-04-26 富士通株式会社 Device and method for processing running context of application in crowdsourcing test
US10248658B2 (en) 2017-01-31 2019-04-02 International Business Machines Corporation Analytics and deduplication for air-gapped log analysis
US10255289B2 (en) 2017-01-31 2019-04-09 International Businss Machines Corporation Analytics and deduplication for air-gapped log analysis
CN107918565A (en) * 2017-11-17 2018-04-17 广东小天才科技有限公司 A kind of report method and mobile terminal of the exception information of application program
CN108829543A (en) * 2018-06-21 2018-11-16 郑州云海信息技术有限公司 A method of reducing backup Linux system log size
CN109062997A (en) * 2018-07-05 2018-12-21 中国电子科技集团公司第五十四研究所 A kind of automatic De-weight method of fence data
CN113849329A (en) * 2021-08-26 2021-12-28 苏州浪潮智能科技有限公司 Log analysis and integration method and system for operating system
CN113849329B (en) * 2021-08-26 2023-07-14 苏州浪潮智能科技有限公司 Log analysis integration method and system of operating system
CN113467407A (en) * 2021-09-06 2021-10-01 西安热工研究院有限公司 Fault information collection method, system and equipment for distributed control system
CN113467407B (en) * 2021-09-06 2021-11-16 西安热工研究院有限公司 Fault information collection method, system and equipment for distributed control system

Similar Documents

Publication Publication Date Title
CN104636242A (en) Method for automatically deleting repeated content in system logs on basis of Linux operating system
US20230138736A1 (en) Cluster file system-based data backup method and apparatus, and readable storage medium
CN109460349B (en) Test case generation method and device based on log
US8990621B2 (en) Fast detection and diagnosis of system outages
CN103744759A (en) Method for verifying unattended disk performance and stability under Linux system
CN104965754A (en) Task scheduling method and task scheduling apparatus
CN104714863A (en) Method for completely storing Raid card logs on basis of Linux operation system after system crashes
CN104572422A (en) Memory monitoring achievement method based on startup and shutdown of Linux system
CN110008129B (en) Reliability test method, device and equipment for storage timing snapshot
CN110704287B (en) RAID card abnormal log collection method and system under Linux system and storage medium
CN103092718A (en) Test data backup system and method
CN112700083A (en) Method and device for constructing scene of resource comprehensive utilization and service index system
TW201335779A (en) File synchronization system and method
CN109902070B (en) WiFi log data-oriented analysis storage search method
CN105608150A (en) Business data processing method and system
CN108459960A (en) Method of automatic configuration, device, equipment and the storage medium of test environment
CN110011854A (en) MDS fault handling method, device, storage system and computer readable storage medium
CN105512004A (en) Method for avoiding server hard disk fault caused by abnormal ambient temperature and humidity
CN112256482A (en) Data processing method and device and server
CN112068981A (en) Knowledge base-based fault scanning recovery method and system in Linux operating system
CN114138424B (en) Virtual machine memory snapshot generation method and device and electronic equipment
CN106126487A (en) A kind of journal file method for splitting and device
CN108664503B (en) Data archiving method and device
CN113392079B (en) Distributed storage cluster log storage optimization method, system and terminal
CN116185706A (en) Data backup method and device, computing and storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150520