i need some help on this script

please help on this script
We need to update the current archving script to handle the feed directory archving.we need latest files on the \file\clarify location.The size of the file is small but there are large number of file each day. The feed directory has something like 10,000-30,000 files
pick up files in xml files
less than equal to 10,000 files
then we check disk partition if it is more than 80% here use mailx cmd send to mail
below 80% disk space to take back up files from source to destination (user4)

please help on the script

ss4u,
I am really sure about your specification -- more details is necessary.
In any event, here is a start.
If you want to select 10,000 'xml' files in the '/file/clarify/' directory:

typeset -i mCnt=0
for mFile in /file/clarify/*.xml
do
  mCnt=$mCnt+1
  if [ $mCnt -eq 10000 ]; then
    exit
  fi
  echo 'Working with count '$mCnt' file = '$mFile
done