I have a new Fedora 9 installation and I'm moving over my scripts from a Fedora 5 installation. Strangely, one of my logrotate scripts fails with a permissions error (when run from logrotate/cron). However, if I run the logrotate script (with -vf) from root account it runs fine. The associated file and directory permissions appear identical!
Can someone help or give some ideas?
Here is the error:
Code:
/etc/cron.daily/logrotate:
/usr/sbin/asterisk -rx 'logger rotate' > /dev/null 2> /dev/null
# Remove rotated logs since already made a copy
rm -f /var/log/asterisk/debug.0
rm -f /var/log/asterisk/messages.0
rm -f /var/log/asterisk/event_log.0
rm -f /var/log/asterisk/queue_log.0
rm -f /var/log/asterisk/faxlog
rm -f /var/log/asterisk/table-cdr.mysql
rm -f /var/log/asterisk/table-cid.mysql
rm -f /var/log/asterisk/table-callednumber.mysql
rm -f /var/log/asterisk/controllog
rm -f /var/log/asterisk/voicemaillog
# Set permissions on file to ensure smrsh can write to it
touch /var/log/asterisk/controllog
chown root:asterisk /var/log/asterisk/controllog
chmod 660 /var/log/asterisk/controllog
touch /var/log/asterisk/voicemaillog
chown root:asterisk /var/log/asterisk/voicemaillog
chmod 660 /var/log/asterisk/voicemaillog
# Extract the cdr and callerid databases, empty the cdr
/data/scripts/backupasteriskdb
: line 21: /data/scripts/backupasteriskdb: Permission denied
error: error running shared postrotate script for '/var/log/asterisk/debug /var/log/asterisk/messages /var/log/asterisk/event_log /var/log/asterisk/queue_log /var/log/asterisk/faxlog /var/log/asterisk/table-cdr.mysql /var/log/asterisk/table-callednumber.mysql /var/log/asterisk/table-cid.mysql /var/log/asterisk/controllog /var/log/asterisk/voicemaillog '
/etc/cron.daily/updatetime:
Here is the contents of the /data/scripts folder:
Code:
-rwxr-xr-x 1 root root 416 2008-09-24 09:50 backupasteriskdb
-rwxr-xr-x 1 root root 374 2008-09-24 09:50 backupasteriskdb~
-rwxr-xr-x 1 root root 81 2006-10-25 11:25 backup-callednumber.mysql
-rwxr-xr-x 1 root root 64 2006-03-18 21:34 backup-cdr.mysql
-rwxr-xr-x 1 root root 63 2006-10-25 11:25 backup-cid.mysql
Thanks!