debian – /etc/cron.daily/logrotate error

Question:

After installing vps with debian 7 and isp manager, every day at night such a chipper comes to the mail:

/etc/cron.daily/logrotate:
run-parts: failed to exec /etc/cron.daily/logrotate: Exec format error
run-parts: /etc/cron.daily/logrotate exited with return code 1

There is nothing related to logrotate in tasks for cron, the file /etc/cron.daily/logrotate is empty.

Answer:

the error can be reproduced if an empty file with executable bits is present in the directory passed to run-parts as an argument:

$ touch file
$ run-parts .
$ chmod +x file
$ run-parts .
run-parts: failed to exec ./file: Exec format error
run-parts: ./file exited with return code 1

solution: delete this empty file, or at least remove the executable bits:

$ sudo chmod -x /путь/к/файлу

There is nothing related to logrotate in tasks for krone

the scripts from /etc/cron.daily executed by the run-parts program, which is started daily by the crond program due to the presence of the corresponding line in /etc/crontab .

Scroll to Top