命令crontab -e 打开的文件以下:php
0 * * * * /usr/sbin/ntpdate time.windows.com */10 * * * * (/usr/bin/php /home/monitor/hddusage.php) 0 */8 * * * (/usr/bin/php /home/monitor/hddhealth.php) # 测试按期转存访问日志文件 1 0 * * * (/bin/bash /data02/xnou/binlog/rotate_nginx_log.sh >> /data02/xnou/binlog/task.log 2>&1 )
这命令能够打开计划任务文件,并在文件里添加任务html
-s (selinux context)java
0 * * * * /usr/sbin/ntpdate time.windows.com */10 * * * * (/usr/bin/php /home/monitor/hddusage.php) 0 */8 * * * (/usr/bin/php /home/monitor/hddhealth.php) # remove expired files in '/tmp' directory. 0 1 * * * ( find /tmp/ -mtime +1 -exec rm -rf {} \; ) */30 * * * * (/usr/bin/php /home/app/polyv/release-current/webapp/WEB-INF/sh/checkStatusQueueTask.php) 15 * * * * (/usr/bin/php /home/app/polyv/release-current/webapp/WEB-INF/sh/checkEncodeTask.php) 10 * * * * (/usr/bin/php /home/app/polyv/release-current/webapp/WEB-INF/sh/checksms.php) 30,50 * * * * (/bin/sh /home/app/polyv/release-current/webapp/WEB-INF/sh/runjava.sh com.cc.ovp.web.stat.MRTask >> /dev/null 2>&1) 30 8 * * * (wget http://misc.polyv.net:8080/send_expiration_email) 59 5 * * * (/usr/bin/php /home/app/polyv/release-current/webapp/WEB-INF/sh/kw_flow_date.php) 22,42,58 * * * * (/usr/bin/php /home/app/polyv/release-current/webapp/WEB-INF/sh/kw_flow.php) # 删除最后修改时间为1天前的源视频文件 30 1 * * * ( find /data/htmlfile/?/video_source -mtime +1 -type f -exec rm -f {} \; ) # 硬盘监控 #*/10 * * * * /usr/bin/php /data/syssh/alert.php */10 * * * * /data/syssh/killffmpeg.sh * * * * * (find /tmp/ -name "*.flv" -mmin +600 -exec rm -rf {} \;) * * * * * (find /tmp/ -name "*.mp4" -mmin +600 -exec rm -rf {} \;) * * * * * (find /data/htmlfile/?/video_target -mmin +200 -type f -exec rm -f {} \;) * * * * * (find /data/htmlfile/?/video_source -mmin +200 -type f -exec rm -f {} \;) #10 * * * * (>/data/mysql/data/log_error.err) 04 18 * * * (/bin/bash /data/nginx/sbin/cut-log-school.sh) # 测试按期转存访问日志文件 1 0 * * * (/bin/bash /data02/xnou/binlog/rotate_nginx_log.sh >> /data02/xnou/binlog/task.log 2>&1 ) */5 * * * * ( find /data/htmlfile/video_image/ -maxdepth 2 -type d -user root -exec chown -R web:web {} \; ) */5 * * * * ( find /data/htmlfile/*/video_source/ -maxdepth 1 -type d -user root -exec chown -R web:web {} \; ) */5 * * * * (/bin/sh /home/app/polyv/release-current/webapp/WEB-INF/sh/runjava.sh "com.ovp.test.TestAllVideoJson") # 无限极首页静态化 */5 * * * * ( wget "http://v.infinitus.com.cn/wxj/home" -O "/home/workspace/wuxianji/target/wuxianji/index.html" 2>&1 )参数很简单,这几个单词相信你们一看就明白了,格式跟方法1讲的同样,须要注意的是 crontab -e 写的是用户本身的计划任务,文件存放在如下目录