Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.
/ cron Public archive

Cron daemon embedded into docker image with logrotate utility

Notifications You must be signed in to change notification settings

liteacz/cron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cron

Table of contents

Usage

Running from terminal:

docker run -d -v /path/to/crontab:/etc/crontab liteacz/cron

Using docker-compose:

version: '3'
services:
  cron:
    image: liteacz/cron
    volumes:
    - /path/to/crontab:/etc/crontab

Logrotate

By default logrotate utility is provided with following configuration:

/var/log/cron.log {
    rotate 10
    size 10M
}

the file can be found in /etc/logrotate.conf.

Feel free to override it using your custom version, but make sure the file has 0644 (is not writable by group or others) otherwise logrotate will refuse to use it.

For more information see manual.

Crontab path

When container is started, it first looks for crontab file in /etc/crontab. This path can be changed via environment variable CRONTAB_PATH. E.g:

docker run -d \
  -e CRONTAB_PATH=/my/custom/crontab \
  -v /path/to/crontab:/my/custom/crontab \
liteacz/cron

About

Cron daemon embedded into docker image with logrotate utility

Resources

Stars

Watchers

Forks

Packages

No packages published