Batch delete specific folder from user home directories

Hi!

Need your help. How can I delete the cache folder of multiple user home directories via automatically executed shell script on a Mac OS X Server?

Example:

The userdata are stored on a Xsan Volume like this:

/Volumes/Xsan/userdata/mike
/Volumes/Xsan/userdata/peter
/Volumes/Xsan/userdata/robert
/Volumes/Xsan/userdata/dave
/Volumes/Xsan/userdata/michael

... etc. (total 1629 user home directories)

and in every userfolder is the same folder structur:

Desktop, Documents, Library, Movies, Music, Pictures and Public

The folder which should be removed is:

/username/Library/Caches

The script should go through all 1629 user home directories and delete the entire cache folder. If the folder don't exist it should ignore and go to the next task. I would like to run this script automatically as a cron job in the night.

Thanks in advance for your help.

Try this. (Not exactly, but should work with minimum changes...)

for every_user in $(ls /Volumes/Xsan/userdata/*)
do
rm -r $every_user/Caches
done

Put this in a shell file and submit it to the cron.

Find command can do this for u

find /Volumes/Xsan/userdata/ -name cache  -print | xargs rm -r