linux remove files older than 30 days code example
Example 1: delete old files linux
find /opt/backup -type f -mtime +30 -exec rm -f {} \;
Example 2: linux delete files older than specific date
find /path ! -newermt "YYYY-MM-DD HH:MM:SS" | xargs rm -rf