Reputation: 95
Here is the script
#!/bin/bash
find /mnt/blah/DB/* -mtime +65 | xargs rm -Rf "{}" \;
I have also tried the following, but neither works and both get the error as per the title.
find /mnt/blah/DB/* -mtime +35 -exec rm {} \;
All help greatly appreciated.
Upvotes: 9
Views: 26968
Reputation: 212268
Just drop the *
and do:
find /mnt/blah/DB -mtime +35 -type f -exec rm {} \;
Listing only the top level directory of the directory tree you want to operate on will be sufficient.
Upvotes: 36