3

I wish to use the following command as a cron job:

/usr/sbin/logrotate /home/xxxx/public_html/cgi-bin/logrotate.conf -f

However the message is:

error: error creating state file /var/lib/logrotate.status: Permission
denied

Is there a way around this?

Mike K.
  • 3,751
  • 28
  • 41
Techiescorner
  • 791
  • 2
  • 12
  • 25

2 Answers2

2

You can specify the output location of the status file:

/usr/sbin/logrotate -s /home/xxxx/logrotate/logrotate.status /home/xxxx/public_html/cgi-bin/logrotate.conf -f
Mike K.
  • 3,751
  • 28
  • 41
0

Try run the cron as sudoer:

sudo /usr/sbin/logrotate /home/xxxx/public_html/cgi-bin/logrotate.conf -f

Avihoo Mamka
  • 4,656
  • 3
  • 31
  • 44