I am writing a shell script to run a mysql backup as a cron job and am hitting an issue with the find command not being supported in the rackspace cloud sites cron environment. Any attempt to use the find command gives: /usr/bin/find: Permission denied
What alternatives are there to doing:
find *.gz -mtime +7 -delete
when the files are named like this :
gzip > /mnt/target03/rest-of-path/web/backups/DATABASENAME_`date "+%Y-%m-%d"`.gz
?
I was hoping that I could parse the file's date without using find in a loop, something like:
FILES=./path/to/files/*
for f in $FILES
do
#delete files older than 7 days without using find
done