It was not working. I manually executed the file ./cleanup_space.sh and found that it's unable to delete files and showing error like Permission Denied each time it's trying to delete a file.
Please specify your operating system and shell details.
Is that code the actual script ?
As it seems it has some extra spaces in last two find statements.
You will need to put the interpreter (magic cookie, shebang) as the first line of your script e.g #!/bin/bash for it to work in crontab.
Yes, this is the original code. Please ignore the extra space, those are typo!
Linux ralprdappl001 2.6.32-504.8.1.el6.x86_64
Could you please write the entire code.
Thanks!
Instead us "writing the entire code" for you, why don't you provide exactly what you have with no "typo" and follow some of the suggestions already provided.
Also you can redirect stdout and stderr in cron to a file (instead of /dev/null) and see how YOU can debug it.
Do come back if you have something more specific than "write the entire code"...
That said (above mods...)
You have errors, but havent shown us the messages, only your interpretation...
Furthermore you have not said who is running the script too, this can have great impact in what you are trying to do, we don't know on what kind of filesystem resides /temp/DCS/NODE etc...
You see, you have not given everything so you cannot expect other to guess in order to reply
So now before expecting anything more please add what is missing