I am trying to delete files down 2 paths that are older than 5 days old. I would like to keep a record of the files deleted. I have tried to create a job called by cron with the desired output file stated either in the job itself or in the crontab entry.
In the job itself:
find /archive/inst5/COMMUN/NODE0000/C0000007 -mtime +5 -exec rm {} \; >> /opt/app/ibm/ihome/inst5/logs/logs_deleted.out
find /backup/inst5 -mtime +5 -exec rm {} \; >> /opt/app/ibm/ihome/inst5/logs/bkups_deleted.out
In crontab:
35 13 * * * . $HOME/.profile >/dev/null 2>&1 ; /opt/app/ibm/ihome/inst11/scripts/prune.sh >> /opt/app/ibm/ihome/inst11/logs/prune.out
However in neither case are the logs being deleted recorded.
Would truly appreciate any suggestions.
Thanks