Script for automatic backup sending by email

Hello everyone!

Does anyone know if you can send the two backup files together in a single email?

Currently I do it this way:

Script
/export file=backup01_mikrotik
/system backup save name=backup02_mikrotik

: global data [/ system clock get date]
: global time [/ system clock get time]
: global name [/ system identity get name]

/tool email send to=“e-mail@gmail.com” subject=“Backup of mikrotik $name” body=“Auto-backup of mikrotik $name performed on $data at $hour.” file=backup01_mikrotik start-tls=yes

/tool email send to=“e-mail@gmail.com” subject=“Backup of mikrotik $name” body=“Auto-backup of mikrotik $name performed on $data at $hour.” file=backup02_mikrotik start-tls=yes

This way I need two lines of script to send each file separately, which ends up sending two separate emails with each file

I would like something like this line that I tried to configure, with the two files on a single command line

/tool email send to=“e-mail@gmail.com” subject=“Backup of mikrotik $name” body=“Auto-backup of mikrotik $name performed on $data at $hour.” file=backup01_mikrotik + file=backup02_mikrotik start-tls=yes

If anyone understood what I meant and can help me with that I would be very grateful. I also don’t know if it is possible to join the two files in a single command line or if it is really necessary to send the files separately.

Thanks!

The embedded help has the answer:

[me@MyTik] > tool e-mail send file=?
File ::= File[,File]
   ...

So just set the file parameter to a comma-separated list of file names rather than a single one.

Hi,

Glad you’re helping me, I’d like to thank you!

But I don’t know much about code and I was wondering how exactly to do it.

I tried that way but it didn’t work
file = [backupx_mikrotik, backupf_mikrotik] start-tls = yes

I wish I could describe exactly how the code would look.

Thanks!

Just file=backupx_mikrotik,backupf_mikrotik (no parentheses, no quotes) should do.

The parentheses in the online help indicate that what is between them is optional.

It worked!

I don’t even know how to thank you, thank you very much!

Thanks to you my email will be more organized.

Have a Merry Christmas and Happy New Year!

Thank you so much!