C
chogger
Guest
Hello everyone,
I have a very strange problem with a simple script. If I start it by hand
it worls perfect.
If I put it into /etc/crontab it doesn't work. All files have 777 rights.
crontab
logrotate script
OS is CentOS 6.4
Output in /var/logs/messages
The logrotate.log is empty but last edited at 23 o clock
Please help me, I am totally clueless
I have a very strange problem with a simple script. If I start it by hand
Code:
/squid/logrotate
If I put it into /etc/crontab it doesn't work. All files have 777 rights.
crontab
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
0 23 * * * root /squid/logrotate
logrotate script
Code:
#!/bin/sh
/usr/sbin/logrotate -v /squid/logrotate.conf > /squid/var/logs/logrotate.log 2>&1
EXITVALUE=$?
if [ $EXITVALUE != 0 ]; then
/usr/bin/logger -t logrotate "Squid Logrotate exited abnormally with [$EXITVALUE]"
fi
exit 0
OS is CentOS 6.4
Output in /var/logs/messages
Code:
Oct 17 23:00:01 proxy01-be logrotate: Squid Logrotate exited abnormally with [1]
The logrotate.log is empty but last edited at 23 o clock
Please help me, I am totally clueless