Logrotate - Rrror Running Postrotate Script

The best way is to edit /etc/cron.daily/logrotate and add a line at the top to use a different temp directory.

TMPDIR=/tmp_safe for example.

That way /tmp is still mounted noexec and the logrotate script will work without errors.

Also The man on logrotate says you can put shell commands between the "prerotate" and "endscript" sections of the configuration file. So you could try putting something like:

prerotate
TMPDIR=mytempdir
endscript

In the configuration files in /etc/logrotate.d.