Linux Scheduled Tasks, system logs, fault handling

Source: Internet
Author: User
Tags rsyslog

                 Scheduled Task management                  At  One-time task settings.   Service Script:/etc/init.d/atd  use method;   #at   13:00  2017-11-4  Enter At> interface, Set up tasks.   finally press Ctrl+d to submit the key combination. Scheduled tasks that have been set up but not yet executed can be queried by the ATQ command. To delete the at task with the specified number, use the ATRM command.              crontab Recurring Task Set service script:  /etc/ Init.d/crondcrontab configuration files and Directories  /etc/crontab:  System task profiles. The tasks required to maintain a Linux system are set automatically by the Linux system and related programs at installation time.  /var/spool/cron/   :   User Cron Task's configuration file storage directory. The Crond daemon automatically checks for changes in/etc/crontab files,/etc/cron.d directories, and/var/spool/cron/directories.   Use the crontab command to manage the user's scheduled tasks.    -e   Edit the Scheduled Tasks list.    -u   Specifies which user the scheduled task is managed to belong to. The    -l    list displays scheduled tasks.    -r   Delete the Scheduled Tasks list.   Format: minutes + hours + Date + month + weekday minutes:  value is 0-59 hours: value is 0-23 daysPeriod: The value is 1 ~ 3 January: The value is 1-12 weeks: The value is 0~7  symbol: " *"   :  represents any time of the range of values. "-"    :    a continuous range of time. ","    :   a discontinuous range of intervals. "/"   :   specify the interval frequency.                   Analyzing and troubleshooting system faults   Log files is a file that records the various running messages in a Linux system.   Log data is divided into the following types of:   cores and system logs: Unified management by the system service Rsyslog, which determines where kernel messages and system program messages are recorded, based on the settings in the Master profile/etc/rsyslog.conf.     user log:  logs the message that the system user logged on and exited the system.    Program Log:  application has its own log file. Log various event messages during program run.   Common log files:/var/log/messages :    record kernel messages and public log messages for various applications. /VAR/LOG/CRON&NBSP: Records event messages generated by Crond scheduled tasks. /var/log/dmesg :   the various event information of the system during the boot process. /var/log/maillog :   records incoming or sent emails to the system. /var/log/lastlog :   records the most recent logon events for each user. /var/log/secure :    records user authentication-related security event messages. /var/log/wtmp :   records each user login, logoff, and system startup and shutdown events. /var/log/btmp :  logs failed, bad logon attempts, and validation events.   Priority of log messages: 0         emerg (Emergency):  causes the host system to be unavailable. 1        alert (warning)  :  need to take immediate action to resolve. 2        crit (severe)  :  more serious. 3        err (Error):  run error occurred. 4        warning (Reminder)   Impact system functions, need to remind users of important events. 5        notice (note)     does not affect normal function, need attention. 6        info (information)     general information.  7 debug (Debug)    program or system debug information.   Log Format: Time label:   the date and time the message was issued hostname     the name of the computer that generated the message. subsystem name:  The name of the application that issued the message. The message:  the specific contents of the message. The  tail, more,less command allows you to view the log contents.   User log:   query the current logged on user    Users   output the name of the user who is currently logged on. The    who command reports information about each user that is currently logged on to the system.             default output includes: User name, terminal type, logon date and remote host. The    w command displays each user in the current system and the process information it is running.     queries the history of the user's login:   last  the user record that the query successfully logged on to the system.    Lastb  Query Login failed user record. View/var/log/secure.     Troubleshooting System Startup Class failure:  MBR sector failure:    MBR Boot Record is located on the 1th sector of the physical hard disk (512B),  primary boot sector (MBR sector)      contains the system boot program and the entire hard disk partition table record.  grub boot failure:    View Grub Profile/boot/grub/grub.conftitle  :  Displays the operating system name. root  :   contains boot files such as the kernel, where the/boot partition resides. kernel :   specifies where the kernel files are located. When the kernel loads, the permissions are read-only and the device file location of the root partition is specified through root= . initrd  Specifies the location of the temporary system image file used by the boot kernel.   Chroot  Command   Switch to the operating system root environment you want to repair.                troubleshoot file system class   repair file system:        Fix general file system errors available  fsck command, -t  options   Specify the file system type.       -y   automatic answers to discovered questions yes.      for example:  fsck    -y   -t   ext4   /dev/sda1   Disk resource exhaustion failure:       Repair I node exhaustion failure:   Locate the file that occupies a large number of I nodes in the partition and delete it.   detects hard drive bad channel:    logic bad channel:  software improper operation.     physical bad:  is improved by changing the footprint of the disk partition or sector.    Use the badblocks command to detect bad-path conditions on the disk.     -s   Options Show progress information, -v  options   Show details.


Linux Scheduled Tasks, system logs, fault handling

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.