Okay, maybe what is happening is that
find is reporting the found directories in a depth-first order, so the lower directories are being moved first. To diagnose, insert the '
echo' command in front of '
mv', so you can see what is happening:
Code:
/usr/bin/find /FTP_Shared/upload/Mp3s/ -depth -mindepth 1 -mtime +14 -type d -exec echo mv -f {} /FTP_Shared/download/Mp3s/ \;
This is generally good practice when developing such scripts, to make sure you've got everything right before you start actually affecting the filesystem. Actually, now that I see your
find command includes the -depth option, I think this is the problem. Remove that, and use breadth-first recursion.
--- rod.