Linux Program task management

Source: Internet
Author: User
Tags linux

There are two types of scheduled tasks: one that is not executed after execution, and one that is executed periodically.

Scheduling tasks are divided into: System scheduling tasks, user-defined scheduling tasks.

The meaning of a scheduled task is to create and manage commands and tasks that are executed automatically over a specified period of time.

1: Short-term execution of Scheduled tasks commands are: At at Command Management ATD process

Usage: at Task_time task_time =now + 4 hours yyyy/mm/hh

ATQ query what tasks ATRM ID Delete Scheduled Tasks

The batch command is exactly the same as the AT command, except that the batch command executes the plan when the system is not busy.

Configuration file:

/etc/at.allow/etc/at.deny these two files control specific users to use at Scheduled tasks, see Help documentation

/etc/spool/at the data for this profile is the location of the task.

2: Cycle Scheduled task Command Crontab management cron process

The crontab command manages two scheduling tasks: System and user.

The system's scheduled tasks are stored under/etc/cron.d/, and if the virus is born into a scheduled task file, it will crash the system.

The format of the crontab scheduled task is detailed in the/etc/crontab file.

System configuration must be in strict accordance with the format, user-defined scheduled tasks do not write user names.

A. Creating a system planning task step:

1:touch/etc/cron.d/myplain

2:vi/etc/cron.d/myplain

0 5-17 */3 * Sun root/root/cron.sh every month three days at 5 o ' ~17 point execution with root script/root/cron.sh

*/5 4 * * * USER/BIN/FSCK daily 4-point execution of command fsck every 5 minutes

B. Create a User plan task:

CRONTAB-E-u root-e option to create a root user task for Edit

Crontab-r-u hu-r delete hu User's task for remove

Crontab-l-U hu-l for list view scheduled tasks

User-Customized scheduled task data is stored under/var/spool/cron/

Cron's configuration file has/etc/crontab/etc/cron.d/*

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.