linux(centos)下自动运行脚本

vi /etc/crontab


SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
05 * * * * root /usr/local/php/bin/php -q / 脚本名字
分_ 时_日_月_星期_用户_命令目录_参数_脚本名字 
~                                                                                                                         

你可能感兴趣的:(linux,PHP,centos,脚本,bash)