Is there errors on this script?

:log info "backup beginning now"
:global backupfile ([/system identity get name] . " - " . [/system clock get date] . " - " . [/system clock get time] )
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="xxx@hotmail.com" subject=([/system identity get name] . " Backup")  file=$backupfile tls=yes
:log info "backup finished

slashes in date returned are not allowed in the filename

Is there a aternatives to show date in the file name?

There is almost always an alternative. Use only the system identity for the backup file name, and put the date/time stamp in the email body.

If I don’t want date or time, Is this code correct:

:log info "backup beginning now"
:global backupfile ([/system identity get name])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="xxx@hotmail.com" subject=([/system identity get name] . " Backup")  file=$backupfile tls=yes
:log info "backup finished

I am not sure about the space and dot in subject=([/system identity get name] . " Backup")

this is the debug of sending the email

03:45:48 e-mail,debug recv: 220 mx.google.com ESMTP k23sm4756755waf.17 
03:45:48 e-mail,debug send EHLO [192.168.x.x] 
03:45:49 e-mail,debug recv: 250-mx.google.com at your service, [x.x.x.x] 
03:45:49 e-mail,debug recv: 250-SIZE 35651584 
03:45:49 e-mail,debug recv: 250-8BITMIME 
03:45:49 e-mail,debug recv: 250-STARTTLS 
03:45:49 e-mail,debug recv: 250 ENHANCEDSTATUSCODES 
03:45:49 e-mail,debug send STARTTLS 
03:45:49 e-mail,debug recv: 220 2.0.0 Ready to start TLS 
03:45:50 e-mail,debug send EHLO [192.168.x.x] 
03:45:50 e-mail,debug recv: 250-mx.google.com at your service, [x.x.x.x] 
03:45:50 e-mail,debug recv: 250-SIZE 35651584 
03:45:50 e-mail,debug recv: 250-8BITMIME 
03:45:50 e-mail,debug recv: 250-AUTH LOGIN PLAIN XOAUTH 
03:45:50 e-mail,debug recv: 250 ENHANCEDSTATUSCODES 
03:45:50 e-mail,debug send AUTH PLAIN AG1hbmFoLndpZmlAZ21haWwuY29tAHNzMTI3NXNz 
03:45:51 e-mail,debug recv: 235 2.7.0 Accepted 
03:45:51 e-mail,debug send MAIL FROM: <xxx@gmail.com> 
03:45:51 e-mail,debug recv: 250 2.1.0 OK k23sm4756755waf.17 
03:45:51 e-mail,debug send RCPT TO: <xxx@hotmaill.com> 
03:45:51 e-mail,debug recv: 250 2.1.5 OK k23sm4756755waf.17 
03:45:51 e-mail,debug send DATA 
03:45:52 e-mail,debug recv: 354  Go ahead k23sm4756755waf.17 
03:45:55 e-mail,debug send .

But I still didn’t get email. But when I use the test

/tool e-mail send to=xxx@hotmail.com subject="test" body="test" tls=yes

,
I am getting the email


Note: I replace some datats with x.

Is there a file generated with the filename you expect in “/file”?
Try the test like this

/tool e-mail send to=xxx@hotmail.com subject="test" body="test" file=filename tls=yes

Replace filename with the correct filename and see if that is sent.

this work and

:log info "backup beginning now"
:global backupfile ([/system identity get name])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="xxx@hotmail.com" subject=([/system identity get name] . " Backup")  file=$backupfile tls=yes
:log info "backup finished

didn’t work

Try this:

:log info "backup beginning now"
:global backupfile ([/system identity get name])
/system backup save name=$backupfile
:log info "backup pausing for 10s"
:delay 10s
:log info "backup being emailed"
/tool e-mail send to="xxx@hotmail.com" subject="$backupfile  Backup" file=$backupfile tls=yes
:log info "backup finished"

Note I changed the subject format on the email send.