Utility crontab Command

Source: Internet
Author: User

Common crontab are as follows:

CRONTAB-E Edit Crontab
Crontab-l Display Crontab
Crontab-r Delete crontab
CRONTAB-V Displays the last time the crontab was edited, but not all systems are applicable.

Edit Crontab
Entering "crontab-e" in the instruction mode will open crontab with the preset editor, in the form of one task per line, and the content of each task will be:

Minute hour Sun Moon Week execution Instruction

The following example automatically executes the/root/sync_time.sh every:00, and if you do not want to store the output, put the output to/dev/null.

0 0 * * * /root/sync_time.sh > /dev/null 2>&2

When you have edited the crontab, save it.

Some practical wording is as follows:

@daily/usr/local/www/awstats/cgi-bin/awstats.sh

The above @daily syntax will be performed:00 every day, and the following are other uses:

@reboot: executed at each boot.
@yearly: equivalent 0 0 1 1 * written, that is, January 1:00 each year.
@annually: Same as @yearly.
@monthly: Executed at:00 per month.
@weekly: Performed on Sunday:00. Run once a week, "0 0 * * 0″.
@daily::00 every day.
@midnight: Same as @daily.
@hourly: Execute 0 minutes per hour.

Crontab Detailed Introduction

Utility crontab Command

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.