What this error means: "Error sending e-mail: error handling file"?
I have script that creates backup both command and binary. Command goes through email with no issues. For binary file I get this error.
/export file="filename.rsc"
/tool e-mail file=filename.rsc
/export file=filename.rsc
# wait export finished
:delay 2s;
/tool e-mail file=filename.rsc
Adding delay work for me. Thanksthe problem is here:
Create filename.rsc.in_progressCode: Select all/export file="filename.rsc"
(or similar, but not just filename.rsc).
-------------------------------------------------------------------------------------------------------Try to get file filename.rscCode: Select all/tool e-mail file=filename.rsc
BUT this file MAY BE still named with .in_progress postfix.
-------------------------------------------------------------------------------------------------------
So, add :delay 2s; before accessing this file:Code: Select all/export file=filename.rsc # wait export finished :delay 2s; /tool e-mail file=filename.rsc
/local filename ([/system identity get name] . "_" . [:pick [/system clock get date] 0 3] . "-" . [:pick [/system clock get date] 4 6] . "-" . [:pick [/system clock get date] 7 11] . ".rsc");
/export file=$filename;
:delay 5s;
/tool e-mail send to="support@mycompany.com" subject="$[/system identity get name] configuration export" \
body="Mikrotik $[/system identity get name]: configuration file on $[/system clock get date] - $[/system clock get time] --- $filename" \
file=$filename;
:delay 45s;
/file remove $filename;