First of all I'm using CentOS
[root@a etc]# cat system-release
CentOS release 6.5 (Final)
[root@a cron.daily]# ps -ef | grep cron
root 982 1 0 Jun14 ? 00:01:15 crond
root 5692 5441 0 00:49 pts/0 00:00:00 grep cron
[root@a cron.daily]#
And I'm running out of my resources, so I want to delete the old log files.In this case i would like to delete the old secure logs which are almost more than 100MB's in size, So i gave the below crontab entries for root
user.
[root@a etc]# crontab -l
0 1 * * * find /var/log -name "secure-*" -mtime +5 -exec rm {} \;
[root@a etc]#
After very few days later i came to know this crontab entry doesn't work and still i see old files.
[root@a log]# find /var/log -name "secure-*"
/var/log/secure-20141214
/var/log/secure-20141107
/var/log/secure-20141130
/var/log/secure-20141221
[root@a log]#
Later i tried to search for the crontab logs under /etc/crontab.daily directory and not found any relevant results. Where to find the crontab logs and how to know whether the crontab is running successfully or not ?