Hi,

You didn't mention about your OS and Oracle version. If you are using Unix, you can find sample scripts in $ORACLE_HOME/rdbms/demo directory. Make a copy of rman1.sh script and modify it. It will check obsolete rman backups, create the cmd file and execute it.

Let us know if you have any question.

Good Luck!

Cheers!

Farrukh