Crontab parameters and how to view log records

Source: Internet
Author: User
Tags tmp file

The parameters of crontab are described in detail and how to view the syntax of the crontab log for future emergency. First, let's look at the super powerful figure: crontab parameter description:-e: Execute the text editor to edit crontab. The final text editor is VI-r: Delete the current crontab-l: list the current crontab (dedicated for viewing)-I: It will be used with-r. When you delete the current crontab, ask. If you enter y, delete it. Note that crontab is user-specific, the crontab special symbol "*" indicates the number in the range of all values. Pay special attention to it! "/" Indicates the meaning of each, for example, "*/5" indicates that each five units "-" indicates that a number is transferred from a number to a number." "example of how to use the scattered number crontab file: 30 21 *** indicates 45 4, 10, 22 *** every night, indicating 4 of day 1, 10, and 22 of every month: 45 10 1 ** 6, 0 indicates to every Saturday and Sunday: every 30 minutes between 00 0 23 ** 6 indicates the 11 of every Saturday: 00 pm **/1 *** every hour * 23-7/1 *** between pm and AM, every hour * 8, 13 ** 1-5 from Monday to Friday eight o'clock A.M. and one o'clock P.M. 0 11 4 * mon-wed 4 of every month and 0 4 jan * from Monday to Wednesday * on March 13, January 1 ------ how to view crontab log records ------- yesterday The synchronization task in crontab is not executed. I don't know why it was not executed. It seems that the task hang is running. I want to check the problem of crontab or where the hang is. 1. in linux, you can view the/var/log/cron file. You can use tail-f/var/log/cron to observe it. 2. unix contains the croutXXX001864 tmp file in the/var/spool/cron/tmp file, and the running tasks can be seen in the tail files. 3. the mail task contains crontab execution logs in the/var/spool/mail/root file, use tail-f/var/spool/mail/root to view the latest crontab execution.

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.