Linux Add timed Task command Crontab-e__linux

Source: Internet
Author: User
Restart TeamViewer every two hours to prevent the outside of the console execution: CRONTAB-E//Enter the Timer edit page, add the following command, Control+c!wq save 0 */2 * * * TeamViewer Deamon
0 */2 * * * echo "Have a break now." >>/tmp/test.txt separated by spaces or tabs between each domain. The format is as follows: minuteHour Day-of-monthMonth-of-year Day-of-weekCommands legal value 00-59 00-23 01-31 01-12 0-6 (0 is Sunday) commands (represents the script to execute)



A few examples: every morning at 6, 0 6 * * * echo "Good morning." >>/tmp/test.txt//Note pure echo, no output from the screen because cron emails any output to Root's mailbox.
Every two hours 0 */2 * * echo "Have a break now." >>/tmp/test.txt
Between 11 o'clock and 8 a.m. every two hours and morning eight 0 23-7/2,8 * * * echo "Have a good Dream" >>/tmp/test.txt
Number 4th per month and weekly Monday to Monday three morning 11, 0 4 * 1-3 command line
January 1 Morning 4 0 4 1 1 * command line Shell=/bin/bash path=/sbin:/bin:/usr/sbin:/usr/bin mailto=root//If there is an error, or there is data output, the data is sent as a message to this An account home=/
Execute script within/etc/cron.hourly per hour * * * * Root run-parts/etc/cron.hourly Daily Execute Script 4 * * * * root run-parts/et in/etc/cron.daily C/cron.daily
Execute/etc/cron.weekly script per week 4 * * 0 root run-parts/etc/cron.weekly
Every month to execute the script in/etc/cron.monthly 4 1 * * Root run-parts/etc/cron.monthly
Note: "Run-parts" This parameter, if you remove this parameter, then you can write a script to run the name, not the folder name.
Every day 4 o'clock in the afternoon, 5 points, 6 points 5 min, min, min, min, min, Min, when the implementation of the order. 5,15,25,35,45,55 16,17,18 * * * command
Every Monday, three, five 3:00 system into the maintenance state, reboot the system. * * 1,3,5 shutdown-r +5
10 minutes per hour, 40 minutes. Innd/bbslin This instruction under User directory: 10,40 * * * * * * Innd/bbslink
1 minutes per hour to execute the Bin/account in the user directory this instruction: 1 * * * * bin/account
Daily 3:20 A.M. Execute two instructions (each instruction is separated) as shown below in the user directory: 3 * * * (/bin/rm-f expire.ls logins.bad;bin/expire$#@62;expire.1st)
Each year in January and April, 4th to 9th, 3:12 and 3:55, execute/bin/rm-f expire.1st This instruction and add the results after mm.txt this file (mm.txt file is located in the user's own directory location). 12,55 3 4-9 1,4 */bin/rm-f expire.1st$#@62;$#@62;mm.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.