2022-12-26 17:51| 发布者: yangy| 查看: 222| 评论: 0
在buildroot里添加logrotate和crond应用,移植到开发板中
在文件系统创建/var/spool/cron/crontab目录
添加/etc/logrotate.d/log文件
/var/log/messages { rotate 7 daily create dateext missingok copytruncate
添加任务脚本,/etc/cron.daily/logrotate
#!/bin/bash/usr/sbin/logrotate /etc/logrotate.d/logRET=$?if [ $RET != 0 ]then /usr/bin/logger -t logrotate "ALERT exited abnormally with [$RET]"fiexit 0
添加任务,crontab -e
0 0 * * * /etc/cron.daily/logrotate
驱动服务 /etc/init.d/S90cron start
/etc/init.d/S90cron start
|小黑屋| 飞凌嵌入式 ( 冀ICP备12004394号-1 )
GMT+8, 2024-11-22 16:41
Powered by Discuz! X3.4
© 2001-2013 Comsenz Inc.