Problems with expect and set variables

I'm writing a script that'll send a time-stamp to my backup server. I create a file with the name of the current date, send it to my server with scp and rm the file from the local computer.

Individually these commands work fine and with a set name the expect scripts also work fine. The problem is when I want to set a variable file_name with the name of the file. Here is the code:

#!/usr/bin/expect -f
file_name=`date +"%F"`.txt
send -- "\r"
touch $file_name
send -- "\r"
set timeout -1
spawn scp $file_name admin@XXX.XXX.X.XXX:/share/destinatino
match_max 100000
expect -exact "admin@XXX.XXX.X.XXX's password: "
send -- "password\r"
expect eof
send -- "\r"
rm $file_name

I've tried many different things like "set file_name `date +"%F"`.txt" or put the whole `date +"%F"`.txt instead of the variable alltogether. This is just what it currently looks like, I'm hoping the problem is straightforward enough so I don't have to print all the errors I've got over the last hours.

For this code it says this:

[root@backup2 script]# ./script.exp
invalid command name "file_name=`date"
while executing
"file_name=`date +"%F"`.txt"
(file "./script.exp" line 3)
[root@backup2 script]#

Different things I've also tried is calling spawn for that set, also removing all the expect code makes it create a file with the right name and delete it. I've also tried putting the variable declaration infront of the including of expect at the begining but it gives the same problem.

I think I used to have spawn for for the touch command and rm at the end but removed it at some point during the testing. They should probably be put ack, doing so and removing all the send-commands and changing all the calls to file_name to just a string "file_name" makes it work but obviously not creating a file with the current date.

That makes me almost 100% certain, and I can't find how it should be, that I'm doing that file_name= thing wrong...

EDIT: Also witing that date-thing instead of the call to the $file_name sort of works but it creates two files like this:

[root@backup2 script]# ./script.exp
spawn touch `date +"%F"`.txt
spawn scp `date +"%F"`.txt admin@XXX.XXX.X.XXX:/some_server
admin@XXX.XXX.X.XXX's password:
`date 100% 0 0.0KB/s 00:00
+"%F"`.txt 100% 0 0.0KB/s 00:00
spawn rm `date +"%F"`.txt
[root@backup2 script]#

I know it's a problem wit the darn quotes but I can't figure out which ones it wants, nothing seem to make it execute the date function.

EDIT 2: Never mind, apparently it wats the entire file dedicated to expect, so I just put the expect part in one script and call it in the middle of creating and removing the file in another script.