This commit is contained in:
Oliver
2025-10-10 14:32:35 -03:00
parent 09c46d4a8c
commit 5fe0fd6028
5 changed files with 32 additions and 1 deletions

8
app/sbin/cleanTmp Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
while true; do
find /tmp -type f -atime +2 -delete
find /tmp -type d -empty -delete
sleep 1d
done

View File

@@ -26,7 +26,7 @@ case "$SECOND_PART" in
"$BIN_PATH/start/n8n"
;;
002)
"$BIN_PATH/start/odoo_18"
"$BIN_PATH/start/ODOO_18"
;;

17
app/templates/init.d/cleanTmp Executable file
View File

@@ -0,0 +1,17 @@
#!/sbin/openrc-run
# OpenRC service for /4server/sbin/cleanTmp
name="cleanTmp"
description="Looping /tmp cleaner that removes files older than 2 days"
command="/4server/sbin/cleanTmp"
command_background="yes"
pidfile="/run/${RC_SVCNAME}.pid"
output_log="/4server/data/log/checkCalls.log"
error_log="/4server/data/log/checkCalls.log"
depend() {
need localmount
after bootmisc
}

View File

@@ -53,6 +53,12 @@ rex doas chown root:root /etc/init.d/checkCalls
rex doas rc-update add checkCalls default
rex doas rc-service checkCalls restart
#INSTALL cleanTmp SERVICE
template templates/init.d/cleanTmp /etc/init.d/cleanTmp
rex doas chmod 0755 /etc/init.d/cleanTmp
rex doas chown root:root /etc/init.d/cleanTmp
rex doas rc-update add cleanTmp default
rex doas rc-service cleanTmp restart
### Infrastructure
##### Docker

Binary file not shown.