diff --git a/api/src/core/logrotate/setup-logrotate.ts b/api/src/core/logrotate/setup-logrotate.ts index c98725a442..577030cdf1 100644 --- a/api/src/core/logrotate/setup-logrotate.ts +++ b/api/src/core/logrotate/setup-logrotate.ts @@ -1,4 +1,5 @@ import { writeFile } from 'fs/promises'; + import { fileExists } from '@app/core/utils/files/file-exists'; export const setupLogRotation = async () => { @@ -8,12 +9,13 @@ export const setupLogRotation = async () => { await writeFile( '/etc/logrotate.d/unraid-api', ` - /var/log/unraid-api/*.log { - rotate 1 - missingok - size 5M - } - `, +/var/log/unraid-api/*.log { + rotate 1 + missingok + size 5M + su root root +} +`, { mode: '644' } ); }