linux crond定时任务

添加定时任务
a) 上传定时清理脚本
将clean.sh 拷贝至/usr/local/etc/
b) vi /etc/crontab
最后一行添加:
00 03 * * * root /usr/local/etc/clean.sh &

代表每天凌晨3点执行
c) 重启crontab
service crond restart


日志/var/log/cron

猜你喜欢

转载自ontheroad-luckhouge.iteye.com/blog/2194243