• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Cron error

Ankebut

Regular Pleskian
Hello,

i receive daily email with cron error and don't known what is here the problem :(

Cron <root@second> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )


/etc/cron.daily/logrotate:
tail: cannot open ']' for reading: No such file or directory
logrotate_script: 3: [: missing ]
 
Hello,

i receive daily email with cron error and don't known what is here the problem :(

I can confirm this happening on Latest plesk.
I get daily messages with this subject:

Cron <root@domain> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )

/etc/cron.daily/logrotate:
tail: cannot open ']' for reading: No such file or directory
logrotate_script: 3: [: missing ]

Any fix coming this way?
 
Here is content of /etc/cron.daily/logrotate script:

# cat /etc/cron.daily/logrotate
Code:
#!/bin/sh

/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
    /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
fi
exit 0

Try to run the command:

# /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf

from this script and find possible errors in the output which will help with troubleshooting.
 
This is what I have:

Bash:
#!/bin/sh

# Clean non existent log file entries from status file
cd /var/lib/logrotate
test -e status || touch status
head -1 status > status.clean
sed 's/"//g' status | while read logfile date
do
    [ -e "$logfile" ] && echo "\"$logfile\" $date"
done >> status.clean
mv status.clean status

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

Is there a reason that the codes is so different?

Thank you
 
I suggest you contact Plesk Support Team. They will check and fix this issue directly on your server.
 
Unfortunately the Plesk license was purchased through a Hetzner dedicated server plan. Plesk support bounces me to Hetzner, and Hetzner says that they do not provide support for this...
 
Unfortunately the Plesk license was purchased through a Hetzner dedicated server plan. Plesk support bounces me to Hetzner, and Hetzner says that they do not provide support for this...
 
Hi, I have the same error on Plesk Obsidian 18.0.29 on debian 9.13. How can I fix it?
My /etc/cron.daily/logrotate looks like this, on Onyx on debian 9.13:
Code:
#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf

The script @cirrus posted fails when there is no entry in /var/lib/logrotate/status or that file contains a malformed line because `while read...` is a bit icky.
So running the command
/usr/sbin/logrotate /etc/logrotate.conf
manually once should fix it.
 
Back
Top