I'm currently using this cron job to delete stalled temp files in a particular location. How can I improve this to only delete files older than x days (e.g., 30 days)?
0 4 * * 0 /bin/rm -fv /home/*/tmp/Cpanel_*
You can use
find /home/*/tmp/Cpanel_*' -type f \! -newermt "month ago" -delete
find can be tricky, so do your homework reading about it and test well. The common practice is to test with a command that doesn't act on found targets, like
find has some builtin commands you can use for testing. So you can start with this:
find /home/*/tmp/Cpanel_*' -type f \! -newermt "month ago" -ls