Requirement is to move the files from source to archive folder adding timestamp I have created the below script but it is not moving the date which i am passing as wild card
File name: Test_20100101.txt
sourcedir=/projects/source
archivedir=/projects/archive
FILE="$1"
for file in $1; do
fileroot=$1
mv -i "$sourcedir/$1"* "$archivedir/$1_$(date +"%Y%m%d_%H%M%S")"
done
while executing i am running the script as below
./archfiles.sh Test_
but the output is coming as
Test__20200107_092902
the actual output should be
Test_20100101_20200107_092902.txt
can you please help me on this