Merge pull request #1255 from jc21/fixes-crash-when-logrotation-fails

This commit is contained in:
jc21 2021-07-24 08:50:12 +10:00 committed by GitHub
commit 6f3a00c9b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -210,8 +210,10 @@ const setupLogrotation = () => {
const intervalTimeout = 1000 * 60 * 60 * 24 * 2; // 2 days
const runLogrotate = async () => {
await utils.exec('logrotate /etc/logrotate.d/nginx-proxy-manager');
logger.info('Logrotate completed.');
try {
await utils.exec('logrotate /etc/logrotate.d/nginx-proxy-manager');
logger.info('Logrotate completed.');
} catch (e) { logger.warn(e); }
};
logger.info('Logrotate Timer initialized');

View File

@ -0,0 +1,4 @@
#!/usr/bin/with-contenv bash
mkdir -p /data/logs
chown -R root:root /data/logs