我有一个cronjob在docker容器中运行logrotate。
/etc/crontab
文件:
30 9 * * * root /usr/sbin/logrotate /etc/logrotate.d/apache2
/etc/logrotate.d/apacha2
文件:
/var/log/apache2/*.log {
daily
missing
rotate 5
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if /etc/init.d/apache2 status > /dev/null ; then \
/etc/init.d/apache2 reload > /dev/null; \
fi;
endscript
prerotate
if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
run-parts /etc/logrotate.d/httpd-prerotate; \
fi; \
endscript
}
文档文件:
…/一些内容/。。。。。。
...........
入口点[“/start”]
开始.sh:
#!/bin/bash
/etc/init.d/cron start
有人能告诉我哪里做错了吗?
我试着在Dockerfile中使用“RUN service cron start”启动cron。这也不起作用。