Linux crontab Creating Scheduled Tasks

Source: Internet
Author: User

Tag: rc.d command means log man png Apache. Local Plan

1. Edit a Scheduled task

Edit Crontab File

Crontab-e

2. View the scheduled task log

View Crontab Logs

Tail-100f/var/log/cron

3. Create a Scheduled task format

(1) Basic Format:* * * * * command time and Moon week the 1th column represents minutes 1~59 per minute with * or */1 to indicate that the 2nd column represents the hour 1~23 (0 means 0 points) The 3rd column represents the date 1~31 4th column represents the month 1~12 5th column identification Number week 0~6 (0 table shown in Sunday) the 6th column to run commands (2) Some examples of the crontab file are: * * * * * * * * * * * * * * * * * * */USR/LOCAL/ETC/RC.D/LIGHTTPD Restart above example indicates that 21:30 restarts Apache per night. 4 1,10,22 * */USR/LOCAL/ETC/RC.D/LIGHTTPD Restart the above example shows the 4:45 restart Apache per month for 1, 10, 22nd. 1 * * 6,0/USR/LOCAL/ETC/RC.D/LIGHTTPD Restart the above example shows that 1:10 restarts Apache every Saturday and Sunday. 0,30 18-23 * * * */USR/LOCAL/ETC/RC.D/LIGHTTPD Restart the above example shows that Apache restarts every 30 minutes from 18:00 to 23:00 every day. 0 * * 6/USR/LOCAL/ETC/RC.D/LIGHTTPD Restart the above example indicates that the Apache is restarted every Saturday. * */1 * * * */usr/local/etc/rc.d/lighttpd restart every hour restart apache* 23-7/1 * */usr/local/etc/rc.d/lighttpd restart 11 o'clock to 7 a.m. , restart every hour apache0 4 * mon-wed/usr/local/etc/rc.d/lighttpd Restart monthly 4th and 11 points per Monday to Wednesday apache0 4 1 Jan */USR/LOCAL/ETC/RC . d/lighttpd Restart January 1 4-point restart Apache

Linux crontab Creating Scheduled Tasks

Related Article

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.