Sorry for digging out old thread, but it came up in Google...
For non-recursive search you need `-maxdepth 1` parameter, not `-xdev` (very different thing). You should also make sure you are deleting files and so you should add `-type f`.
So the command might look like this:
Code:
find /home/backup/mysql_*.gz -maxdepth 1 -type f -mtime +7 -delete
You could also use `-iregex` to control matches a bit more. I personally like POSIX RegExp (like in e.g. JavaScript). With regexp the command might look like this:
Code:
find /home/backup/mysql_*.gz -maxdepth 1 -regextype posix-extended -type f -mtime +7 -iregex '.+-[0-9]{4}0[^16][0-9]{2}-[0-9]{4}\.tar\.gz' -delete
Above will
not match e.g. ...-20120131-... and so preserve January and June backups. Correct RegExp depends on your date/time format.