Techiescorner
Techiescorner

Reputation: 811

Logrotate cronjob not running

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?

Upvotes: 3

Views: 953

Answers (2)

Mike K.
Mike K.

Reputation: 3789

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

Upvotes: 2

Avihoo Mamka
Avihoo Mamka

Reputation: 4786

Try run the cron as sudoer:

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

Upvotes: 0

Related Questions