It is very common to use crontab timers in the usual server management, but there are several issues to be aware of when using them:
1, to pay attention to the format of the Crontab 5 * must not be written wrong, the internet to find a picture can be very intuitive to identify the crontab * value problem:
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/86/E3/wKiom1fOMaeite_5AAA3lpkGK7w891.png-wh_500x0-wm_3 -wmp_4-s_286108073.png "title=" crontab file description. png "alt=" wkiom1fomaeite_5aaa3lpkgk7w891.png-wh_50 "/>
2, if the system crontab after the SendMail does not start, then the program executed in crontab has output content, the output will be sent to the user in the mail, the accumulation of files are saved in the/var/spool/clientmqueue directory, We can usually add >/dev/null 2>&1 after the statement with the output content, but sometimes there will always be missing, then we can use a small script scheduled 3 days to clean up the line.
1 */3 * */usr/local/scripts/delmail.sh[[email protected] scripts]# cat delmail.sh#!/bin/bashcd/var/spool/ Clientmqueue/ls |xargs RM-RVF;
This article from the "Technical essay" blog, reproduced please contact the author!
Considerations for using Crontab under UNIX