Linux crontab Scheduled Task settings (simple knot)

Source: Internet
Author: User

Command:

Crontab-l View the currently running scheduled tasks

CRONTAB-E Edit current Run scheduled task modify or add

Press the I key to enter the edit text state, ESC ends the edit state: Wq save exit.

To configure the execution period:

* * * * * command

Time-sharing Weekly command

The 1th column represents minutes 1~59 per minute with * or */1
The 2nd column represents the hour 1~23 (0 means 0 points) //Example: * 6 * * * command means 6 points per day; * */6 * * * command means every 6 hours;
The 3rd column represents the date 1~31
The 4th column represents the month 1~12
5th Column Identification Number Week 0~6 (0 = Sunday)
6th List of commands to run

Some examples of crontab files:

* * * * */usr/local/etc/rc.d/lighttpd restart
  The above example shows a 21:30 restart lighttpd per night.

4 1,10,22 * */USR/LOCAL/ETC/RC.D/LIGHTTPD restart
  The above example shows a 4:45 restart lighttpd per month for 1, 10, 22nd.

1 * * 6,0/USR/LOCAL/ETC/RC.D/LIGHTTPD restart
  The above example shows a 1:10 restart lighttpd per Saturday and Sunday.

0,30 18-23 * * */usr/local/etc/rc.d/lighttpd restart
  The example above shows that LIGHTTPD restarts every 30 minutes from 18:00 to 23:00 every day.

0 * * 6/USR/LOCAL/ETC/RC.D/LIGHTTPD restart
  The above example shows the restart of lighttpd per Saturday.

      

Linux crontab Scheduled Task settings (simple knot)

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.