I'm trying to delete a folder contents in unix based on the date created using the following statement in a shell script.
find /mypath -mmin +$((60*24*1)) -exec rm -rf {} \;
I have configured to run this script from Control M. This deletes the folder however the script ends with the error code 1. How can i avoid getting the error so that my job does not get failed?
find: '/mypath/Xdb/20170802_001028': No such file or directory
find: '/mypath/Xdb/20170802_001027': No such file or directory
find: '/mypath/Xdb/20170801_142539': No such file or directory