1. Scheduled Tasks
CRONTAB-LCRONTAB-E/sbin/service crond Start//start service/sbin/service Crond stop//shutdown service/sbin/service crond Restart// Restart Service/sbin/service Crond Reload//Reload configuration/sbin/service crond Status//view service Status */1 * * * */opt/shell/load-check.sh00 03 * * */opt/shell/download_log.sh* */1 * * */opt/shell/diskfree.shps-ax | grep cron
2. Send mail
#!/bin/bashpercent= ' df -k | grep -v filesystem| awk ' {print int} ' for each_one in $percentdo if [ $each _ one -ge 90 ];then echo $each _one email_date=$ (date "+%y-%m-%d %h:%m:%s") echo "email_date : " $email _date >> /opt/disk.log echo "server : 120.132.38.102" >> /opt/disk.log df -h > > /opt/disk.log from_name= " Shaohua " from=" [Email protected] " r1= "[email protected]" to= "< $r 1>" #email_title = "120.132.38.102 disk critical" email_content= "/opt/disk.log" email_subject= "120.132.38.102 disk critical" echo -e "to: ${to}\nfrom: \" ${from_name}\ " <${from}>\nsubject: ${email_ subject}\n\n ' cat ${email_content} ' | /usr/sbin/sendmail -t rm -rf /opt/disk.log break fidone
linux-no.03 Linux Set Timer task Send mail function