Enhance cleanup process in LinuxTest by adding log rotation and truncation for bunkerweb logs

This commit is contained in:
Théophile Diot 2024-12-29 13:46:42 +00:00
parent 75a8f39670
commit f340999140
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -140,7 +140,7 @@ class LinuxTest(Test):
try:
proc = self.docker_exec(
self.__distro,
f"cd /opt/{self._name} ; ./cleanup-linux.sh ; rm -rf /etc/bunkerweb/configs/* ; rm -rf /etc/bunkerweb/plugins/* ; rm -rf /var/www/html/*",
f"cd /opt/{self._name} ; ./cleanup-linux.sh ; rm -rf /etc/bunkerweb/configs/* ; rm -rf /etc/bunkerweb/plugins/* ; rm -rf /var/www/html/* ; journalctl --rotate --vacuum-time=1s ; truncate -s 0 /var/log/bunkerweb/error.log ; truncate -s 0 /var/log/bunkerweb/access.log ; truncate -s 0 /var/log/bunkerweb/scheduler.log",
)
if proc.returncode != 0:
raise Exception("docker exec rm failed (cleanup)")