cd $db_backup_dir nbackup_now=`ls -l "$db_name"*|wc -l` if[[$nbackup_now-gt$nbackup]] then nmv=$(( nbackup_now - nbackup )) fi mv_name=`ls -ltr "$db_name"*|head -n $nmv|awk '{print $8}'` for imv_name in $mv_name do mv "$imv_name""$db_recyle_dir" done