Я хочу повернуть системный журнал для тестирования.
sudo logrotate -f /var/log/syslog
[sudo] password for stephen:
error: Ignoring /var/log/syslog because the file owner is wrong (should be root or user with uid 0).
Владелец похож на это:
ll /var/log/syslog
-rw-r----- 1 syslog adm 268K 2020-08-01 08:39 /var/log/syslog
Хорошо, но давайте попробуем с корневой оболочкой.
#echo $UID
0
#logrotate -f /var/log/syslog
error: Ignoring /var/log/syslog because the file owner is wrong (should be root or user with uid 0).
Где ошибка? Что такое обходное решение?
Usage: logrotate [-dfv?] [-d|--debug] [-f|--force] [-m|--mail=command] [-s|--state=statefile] [-v|--verbose] [-l|--log=logfile] [--version] [-?|--help] [--usage] [OPTION...] < configfile >
sudo logrotate -f /etc/logrotate.conf
It has to be run on a config file... This will run logrotate on all the logs designated by the config.