Path of my conf file: /home/my_home/config_files/ my conf file:
/home/my_home/zookeeper/zookeeper-node-*.out {
rotate 15
size 1K
su me me
olddir /home/my_home/logs/zookeeper
createolddir 0775 carbon carbon
copytruncate
compress
maxage 7
missingok
}
- When I run this job manually "logrotate nohup_zk.conf" while i logged in as carbon user , it is working fine as expected.
- But when I run this job using cron "*/1 * * * * carbon run-parts /home/my_home/config_files/" , I am getting an error saying permission denied to create /home/my_home/logs directory.
Note: In cofig_files i have a script which uses logrotate command and executes the conf file in other directory
But when I run it manually it created the logs directory and the rotated log file as well