Yep you are right I grabbed the wrong entry from the log, Sorry for the confusion.
I initially tried running the job from the system cron using the following (which matches the log I posted above.)
Code:
root@debian01:/# crontab -e
Code:
20 10 * * * someguy /usr/bin/find /home/someguy/TEST/*.txt -type f -mtime +14 -exec rm -f {} \; >> /home/someguy/TEST/cronlog 2>&1
20 10 * * * someguy /usr/bin/find /home/someguy/TEST/*.php -type f -mtime +14 -exec rm -f {} \; >> /home/someguy/TEST/cronlog 2>&1
Code:
Nov 6 10:10:01 debian01 /USR/SBIN/CRON[22483]: (root) CMD (someguy /usr/bin/find /home/someguy/TEST/*.txt -type f -mtime +14 -exec rm -f {} \; >/dev/null 2>&1)
Nov 6 10:10:01 debian01 /USR/SBIN/CRON[22484]: (root) CMD (someguy /usr/bin/find /home/someguy/TEST/*.php -type f -mtime +14 -exec rm -f {} \; >/dev/null 2>&1)
Which didn't work, it deleted the files owned by root.
so I then tried it in cron under the someguy account.
Code:
someguy@debian01:~$ crontab -u someguy -e
Code:
06 10 * * * /usr/bin/find /home/someguy/TEST/*.txt -type f -mtime +14 -exec rm {} \; >/dev/null 2>&1
06 10 * * * /usr/bin/find /home/someguy/TEST/*.php -type f -mtime +14 -exec rm {} \; >/dev/null 2>&1
which resulted in the following log
Code:
Nov 7 10:06:01 debian01 /USR/SBIN/CRON[26286]: (someguy) CMD (/usr/bin/find /home/someguy/TEST/*.txt -type f -mtime +14 -exec rm {} \; >/dev/null 2>&1)
Nov 7 10:06:01 debian01 /USR/SBIN/CRON[26287]: (someguy) CMD (/usr/bin/find /home/someguy/TEST/*.php -type f -mtime +14 -exec rm {} \; >/dev/null 2>&1)
Both methods resulted in the cron job deleting the .php files owned by root.