Auto Backup Filename.backup and Send To Gmail - MikroTik Script RouterOS

How To Auto Backup Filename.backup and Send To Gmail

Setup Your mail first on Tool > Email

/tool e-mail set address=74.125.200.109 [email protected] password=xxxx port=587 start-tls=yes [email protected]
Input this script to Scheduler and you can set backup to gmail every week use interval like "7d 00:00:00"

#************************************************************
# BACKUP FILENAME.BACKUP AND SEND TO GMAIL 
#************************************************************
:global backupfile ([/system identity get name] . "-" . [/system clock get time])
/system backup save name=$backupfile
:delay 30s
:log info "backup being emailed"
/tool e-mail send to="[email protected]" subject=([/system identity get name] . " - ". [/system clock get time] . " - " . [/system clock get date] . "") [email protected] file=("$backupfile" . ".backup")
:delay 30s
/file remove ("$backupfile" . ".backup")