how to write script for log delete files older than x days in centos code example Example: delete old files linux find /opt/backup -type f -mtime +30 -exec rm -f {} \;