You can use the date command to give you back the current date, or modify it to give you the dates you want. For example, this will give you todays date:
While this will give you yesterday:
$(date -d "-1 day" +"%Y%m%d")
If you use those in a bash script, you can do what you need. Since I am not sure of which files you do not want in the future, to start, here is something basic.
previous=`cat new_file | grep -o $now_Employee.txt`
if [ -z $previous ]
mv $source/$now_Employee.txt $destination/$now_Employee.txt
echo $source/$now_Employee >> new_fileelse
echo "This has already been done"fi
This will work for todays date only, but can be modified to what you need to do.
To loop through the last 30 days, add in a for loop:
for (( x=0 ; x < 30 ; x++ ))
d=`date -d "-$x day ago" +%Y-%m-%d`
#do the above here in place of now
mv $source/$d_Employee.txt $destination/$d_Employee.txt