My requirements are pretty much the same as this question: Shell script to delete directories older than n days I've got directories that look like this:
Jul 24 05:46 2013_07_24
Jul 31 22:30 2013_08_01
Sep 18 05:43 2013_09_18
Oct 07 08:41 2013_10_07
I want to remove anything older than 90 days. Based on the solution given in the aforementioned thread, I used the following in my script:
find $BASE_DIR -type d -ctime +90 -exec rm -rf {} \;
The script is successfully deleting the directories, but it is also failing with this error:
find: 0652-081 cannot change directory to <actual_path>:
: A file or directory in the path name does not exist.
The only thing here that $BASE_DIR points to a location that's virtual location and the actual_path in the error message points to the actual location. There are soft links in the environment.