Linux Crontab timed tasks

Source: Internet
Author: User

CRONTAB Introduction * * * *
In short, crontab is a custom timer.

Crontab configuration File * * * *

    • One/var/spool/cron/
      This directory contains crontab tasks for each user (including root), named after the user name
    • Second:/etc/cron.d/
      This directory is used to store any crontab files or scripts to be executed.

Crontab Time Description * * * *

# .---------------- minute (0 - 59) # |  .------------- hour (0 - 23)# |  |  .---------- day of month (1 - 31)# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ... # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7)  OR#sun,mon,tue,wed,thu,fri,sat # |  |  |  |  |# *  *  *  *  *  command to be executed

Minute: Represents the first part of an hour in the range 0-59.
Hour: Represents the first hour of the day, Range 0-23.
Mday: Represents the day of the one month, the range 1-31.
Month: Represents the month ordinal of a year, with a range of 1-12.
Wday: Represents the day of the week, and the range 0-7 (0 and 7 are Sunday).
Who: To use what identity to execute the directive, when you use CRONTAB-E, you do not have to add this field.
Command: The command to execute.

Crontab Service Status * * * *

sudo service crond start     #启动服务sudo service crond stop      #关闭服务sudo service crond restart   #重启服务sudo service crond reload    #重新载入配置sudo service crond status    #查看服务状态

crontab Command * * * *
Reassign crontab scheduled Task List files

crontab $filepath

View Crontab Scheduled Tasks

crontab -l

Edit timed Task Delete-add-Modify

crontab -e


Alicfeng
Links: http://www.jianshu.com/p/838db0269fd0
Source: Pinterest
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.

Linux Crontab Scheduled Tasks

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.