Linux scheduled actuator crontab requirement: Linux regularly executes specified commands, such as backing up the database every early morning and regularly cleaning the log. Use crontab-it is used to allow users to execute programs at a fixed time or interval. -Uuser indicates setting the specified...
Linux scheduled actuator crontab requirement: Linux regularly executes specified commands, such as backing up the database every early morning and regularly cleaning the log. Use crontab-it is used to allow users to execute programs at a fixed time or interval. -U user is used to set the time table of the specified user. The premise is that you must have the permission (for example, root) to specify the time table of another user. If-u user is not used, the time table is set. Www.2cto.com common parameters: crontab-l // view the cron task crontab-r under the current user // delete the current time table crontab-e // edit the current user's scheduled task crontab-u linuxso-e/ /edit the usage and format of so scheduled tasks: basic format: f1 f2 f3 f5 program hour day month week command (note: There is only one space between them) where f1 represents minutes, f2 represents hours, f3 indicates the day of a month, f4 indicates the month, and f5 indicates the day of a week. Program indicates the program to be executed. When f1 is *, the program is executed every minute, when f2 is *, the program is executed every hour, and so on; when f1 is a-B, it indicates that execution is performed from the minute a to the minute B. When f2 is a-B, it indicates that execution is performed from the hour a to the hour B, and so on;
When f1 is */n, the execution is performed every n minutes. if f2 is */n, the execution is performed every n hours; www.2cto.com when f1 is a, B, c ,... a, B, c ,... execute in minutes. f2 is a, B, c ,... a, B, c... execute in hours, and so on. You can also store all settings in the file first, and use crontab file to set the time table. Use instances: 1, every Monday, 3, and 5 to clear logs at AM: enter the command: crontab-e to edit the scheduled task of the current user, enter the VI operation, and enter the insert mode, add scheduled execution commands later. 0 2 ** 6.0.14, 5 echo "">/home/tomcat-/logs/catalina. out
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.