For cron jobs any more complex than your example, I like to put the cron jobs in scripts under ~/cron/, then I can comment them as to who wrote them, why they're there and when they were installed.
One way to do the math on your date would be like this. I wouldn't incorporate this into a one-liner, although I'm sure it's possible with multiple escapes and stuff:
printf "%d-%02d-%02d" `date +%Y` $((`date +%m`-1)) `date +%d`
(serverfault swallowed my backticks... I think I got them to show)
IMHO, find is better for removing files. Look for files which match your pattern older than the date. It's safer and doesn't leave things around in extended power downs.
It might even look clean in a one-liner... I'll dig around for an example.
Aha, here's an example where the files "noooo" and "omg" get clobbered because of something in the ./findtest/ directory:
$ ls -R
.:
findtest noooooo omg
./findtest:
mydb- file is * mydb-old-file.gz
$ rm `find ./findtest/ -name mydb*`
rm: cannot remove `./findtest/mydb-': No such file or directory
rm: cannot remove `file': No such file or directory
rm: cannot remove `is': No such file or directory
rm: cannot remove `findtest': Is a directory
$ ls -R
.:
findtest
./findtest:
mydb- file is *
Good way:
$ find ./findtest/ -name mydb* -exec rm {} \;
$ ls -R
.:
findtest noooooo omg
./findtest:
$