Add the scheduled Task Command crontab-e in CentOS

Source: Internet
Author: User

Add the scheduled Task Command crontab-e in CentOS
Restart teamviewer every two hours to prevent external connection to the console and execute: crontab-e // enter the timer editing page. Add the following command: control + c! Wq save 0 */2 *** teamviewer deamon restart0 */2 *** echo "Have a break now. ">/tmp/test.txt each field is separated by spaces or tabs. The format is as follows:MinutehourDay-of-monthmonth-of-yearThe valid value of day-of-weekcommands is 00-59 00-23 01-31 01-12 0-6 (0 is Sunday) commands (representing the script to be executed). Example: every morning at, **** echo "Good morning. ">/tmp/test.txt // note that no output is visible from the screen with pure echo, because cron has emailed any output to the root mailbox. 0 */2 *** echo "Have a break now every two hours. ">/tmp/test.txt every two hours from PM to AM and am, 8 *** echo "Have a good dream">/tmp/test.txt am, am. command line, January 1, January 1 1 1 * command line SHELL =/bin/bash PATH =/sbin: /bin:/usr/sbin:/usr/bin MAILTO = root // if an error occurs or data is output, send data to the account HOME =/execute/etc/cron every hour. hourly script 01 *** root run-parts/etc/cron. hourly runs/etc/cron every day. d Aily script 02 4 *** root run-parts/etc/cron. run/etc/cron every week in daily. weekly script 22 4 ** 0 root run-parts/etc/cron. weekly executes/etc/cron every month. monthly script 42 4 1 ** root run-parts/etc/cron. monthly note: "run-parts" is the parameter. If this parameter is removed, you can write a script name to be run later, instead of the folder name. Execute the command at four o'clock P.M., or every day. 5, 15, 25, 35, 45, 55, 16, 17, 18 *** the system enters the maintenance status at every Monday, 3, and 5, and restarts the system. 00 15 ** 1, 3, 5 shutdown-r + 5 10 points per hour, 40 points to execute the innd/bbslin command in the user directory: *** innd/bbslink executes the bin/account command in the user directory every hour: 1 *** bin/account execute the following two commands in the user directory at 03:20 every morning (each command is separated ): 20 3 *** (/bin/rm-f expire. ls logins. bad; bin/expire $ # @ 62; expire.1st) January and April of each year, run the/bin/rm-f expire.1stcommand from 03:12 to 03:55 on the 9th, and paste the result to the end of the mm.txtfile (the mm.txt file is located in your own directory ). 3 4-9 */bin/rm-f expire.1stre%@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.