Silence output from gzip in logrotate()

- system may not have gzip (we're opportunistic)
- system may not have the log file (yet)

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-03-12 13:26:50 +01:00
parent 1edc4356a6
commit ac17d7f5a7
+1 -1
View File
@@ -80,7 +80,7 @@ int logrotate(char *file, int num, off_t sz)
}
if (cnt == 2 && fexist(nfile)) {
if (systemf("gzip %s", nfile))
if (systemf("gzip %s 2>/dev/null", nfile))
continue; /* no gzip, probably */
(void)remove(nfile);