Add docker volumes janitor
This cleans up tmp and logrotates /var/log every 12 hours. Note that this janitor is separate from the box janitor because they run as different users. Fixes #503
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
Description=Cloudron Smart Cloud
|
||||
Documentation=https://cloudron.io/documentation.html
|
||||
StopWhenUnneeded=true
|
||||
Requires=box.service janitor.timer
|
||||
After=box.service janitor.timer
|
||||
Requires=box.service janitor.timer docker_janitor.timer
|
||||
After=box.service janitor.timer docker_janitor.timer
|
||||
# AllowIsolate=yes
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Docker Volumes Janitor
|
||||
OnFailure=crashnotifier@%n.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=no
|
||||
ExecStart=/usr/sbin/docker_janitor
|
||||
KillMode=process
|
||||
User=root
|
||||
Group=root
|
||||
MemoryLimit=50M
|
||||
WatchdogSec=180
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Docker Volumes Janitor
|
||||
StopWhenUnneeded=true
|
||||
|
||||
[Timer]
|
||||
# this activates it immediately
|
||||
OnBootSec=0
|
||||
OnCalendar=*-*-* 0,6,12,18:00:00
|
||||
Unit=docker_janitor.service
|
||||
|
||||
Reference in New Issue
Block a user