cd $db_backup_dir not_mv_name=`ls -ltr ${db_name}*|tail -n${nbackup}|awk '{print $8}'` all_name=`ls -ltr ${db_name}*|awk '{print $8}'` for i in ${all_name[@]} do need_mv=1 for j in ${not_mv_name[@]} do
if[$i=$j] then need_mv=0 fi done if[$need_mv-eq 1 ] then mv $i"$db_recyle_dir" fi done