#!/bin/bash # deletes only files older than 30 days find /path/to/tmpfolder/ -type f -mtime +30 | xargs rm