Py学习  »  docker

Logrotation没有通过cron作业在docker容器中运行

Raghu • 5 年前 • 1488 次点击  

我有一个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。这也不起作用。

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/50874
 
1488 次点击  
文章 [ 2 ]  |  最新文章 5 年前