shell script for moving all the file from the same folder

Hi ,
I need a shell script which basicaly moves all the files from one folder say folder x to folder y and once they are moved to folder y a datetimestamp should be attached to there name

for ex
file a should be moved to y folder and renamed as a_20081015

dir_x=/path/to/directory_x
dir_y=/path/to/directory_y
datestamp=$(date +%Y%m%d)
cd "$dir_x" || exit 1
for file in *
do
 mv "$file" "$dir_y/${file}_$datestamp"
done