logrotate cron job not rotating certain logs
I added two scripts in "logrotate.d" directory for my application logs to be rotated.
This is the config for one of them: Quote:
Quote:
But I find my application logs alone are not getting rotated, whereas other logs like httpd are getting rotated And I also don't see any output in the mentioned "logrotate_error" file (has write permission for all users). However the syslog says: "logrotate: ALERT exited abnormally with [1]" But when I run the same "logrotate" in "cron.daily" script manually, everything seems working fine. Why is it not rotating during daily cron schedule? Am I doing something wrong here? It would be great if I get this much needed help. |
"&>>" doesn't make sense. Certainly not in bash.
# echo blah &>> afile -bash: syntax error near unexpected token `>' just run the logrotate entry yourself: /usr/sbin/logrotate -v /etc/logrotate.conf and see what happens then. |
Thanks for your reply.
I tried executing that script manually and checked that it's logging it's output (both stdout and stderr) in the mentioned file. I don't know if that is to do something with bash version. On 3.2.48, it gave the same error which you have mentioned, but on 4.1.2, where the logrotate script is running, it looks fine. |
It looks like, it's because of selinux - the log files in my user home directory has restrictions imposed by selinux and the when logrotate script is run:
Quote:
|
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate. Please, follow discussion here: http://www.linuxquestions.org/questi...gs-4175455881/
|
All times are GMT -5. The time now is 10:56 AM. |