|I have 3 comments:|
1) You did well to use #!/bin/ksh or whatever shell you are using. Most every unix system I've worked on, cron uses the Bourne shell by default, #!/bin/sh. Therefore, a script with no shell defined may work fine when executed from your user's shell, but fail in cron. It's a good idea to always declare the shell you are using.
2) I don't want to elaborate on the obvious, but if your script isn't removing the files, it's because you haven't changed to the working directory. Depending on how you wrote the script, this command should be there:
3) One of the common problems is the script works fine from the command line, but not from cron, is the PATH variable isn't set in the script. Cron probably uses a different PATH than the one used in your environment. Just echo your PATH variable:
Set that value in your script:
What you should have learned is always set your shell and always set PATH in scripts.