I have following logrotate configuration file
/home/application/*/shared/log/*.log {
daily
rotate 10
missingok
nocompress
notifempty
copytruncate
sharedscripts
postrotate
echo "Hi....."
/home/application/test.sh > /home/application/test_bash.log 2>&1
echo "By....."
endscript
}
/home/application/test.sh currently content is following (I try in shell script create dummy file too, but no success)
#!/bin/sh
echo "=============================================="
When I run logrotate all files are successfully rotated but test.sh script is not executed
Logrotate potput looks following:
running postrotate script running script with arg /home/application//shared/log/.log : " echo "Hi....." /home/application/test.sh > /home/application/test_bash.log 2>&1 echo "By....." "
/home/application/test_bash.log log file is not created.
I even try simple such example
/home/application/*/shared/log/*.log {
daily
rotate 10
missingok
nocompress
notifempty
copytruncate
sharedscripts
postrotate
mkdir /home/application/demo_v2/shared/log/arch
endscript
}
Why logrotate is not executing my shell script? What I am doing incorrect?