Getting Started with cron timer execution tools under Linux

Source: Internet
Author: User
Tags execution linux

Cron is a regular execution tool under Linux that can run jobs without human intervention. Because Cron is a built-in service for Linux, it does not automatically get up and you can start and close this service in the following ways:

/sbin/service crond Start//boot service

/sbin/service Crond Stop//Off service

/sbin/service crond Restart//Restart service

/sbin/service Crond Reload//Reload Configuration

You can also start this service automatically when the system is started:

At the end of the/etc/rc.d/rc.local script, add:

/sbin/service Crond Start

Now that the Cron service is in the process, we can use this service, and the Cron service provides the following interfaces for everyone to use:

1. Edit directly with crontab command

The Cron service provides the crontab command to set the Cron service, and here are some of the parameters and instructions for this command:

Crontab-u//Set a user's Cron service, which is required by the general root user when executing this command

CRONTAB-L//list details of a user's cron service

Crontab-r//Remove cron service for no users

CRONTAB-E//Edit a user's cron service

For example, root view your cron settings: Crontab-u root-l

Again for example, Root wants to delete Fred's cron settings: Crontab-u fred-r

When editing a cron service, there are some formatting and conventions for editing the content, input: Crontab-u root-e

into the vi editing mode, the contents of the edit must conform to the following format: */1 * * * * ls >>/tmp/ls.txt

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.