I have 10 mikrotik’s and i want take the backup automatically into my gmail .
please suggest me the steps .
I have 10 mikrotik’s and i want take the backup automatically into my gmail .
please suggest me the steps .
make script and add it ti sheduler
script is smth like (you can add to it any information you need: date, identity and so on):
/export file=“filename”
/tool e-mail send to=yourmail@gmail.com subject=“bla-bla-bla settings” file=“filename.rsc”
and don’t forget to set up tools-email on your mikrotiks
take a look at the link above. i am using this script.
But you have lots of script in your provided link . Do i have to enter all the scripts in the mikrotik ??
I only see one script and in the top part you put your own data. The second lines are the scheduler needed to run script.
In the comments there is a adoped version for Dropbox.
i want to show u something but i cant add the attachments ..
Please explain me it step by step ..
I have below doubts ..
Tools>Email
Server:
Port:
From:
user:
Password:
Tools>Email>Send Email>
Address:
Port:
user:
Password:
To:
CC:
From:
Subject:
System>Schedule >
what should I enter in these above steps ??
in “send email” - nothing
in tools-email (for gmail):
server: smtp.gmail.com
port 25
start tls yes
from “your_mail_user@gmail.com” - from this e-mail messages will be send
user your_mail_user@gmail.com
password yourpassword
Updated the script due to strange characters in the copy-paste from the original site.
Update 2: I did try to run it myself but was not able to get it running and it seems it does not start at all
I have updated the script also to use TLS (thanks to Shadeofspitit) and you have to replace SECRET with your password for Gmail and you have to change your e-mail address I stated to your real e-mail adress. I have also corrected some Property to be up-to-date to the current RouterOS.
If it works let us know in this topic.
Information taken form this page: https://wiki.mikrotik.com/wiki/Manual:Tools/email#Properties
#Your email address to receive the backups
:local toemail "laxmimikrotik@gmail.com"
#The From address (you can use your own address if you want)
:local fromemail "laxmimikrotik@gmail.com"
#A mail server your machines can send through
:local emailserver "smtp.gmail.com"
#A mail Password for your Gmail account
:local pass "SECRET"
############## Don't edit below this line ##############
:local sysname [/system identity get name]
:local textfilename
:local backupfilename
:local time [/system clock get time]
:local date [/system clock get date]
:local newdate "";
:for i from=0 to=([:len $date]-1) do={ :local tmp [:pick $date $i];
:if ($tmp !="/") do={ :set newdate "$newdate$tmp" }
:if ($tmp ="/") do={}
}
#check for spaces in system identity to replace with underscores
:if ([:find $sysname " "] !=0) do={
:local name $sysname;
:local newname "";
:for i from=0 to=([:len $name]-1) do={ :local tmp [:pick $name $i];
:if ($tmp !=" ") do={ :set newname "$newname$tmp" }
:if ($tmp =" ") do={ :set newname "$newname_" }
}
:set sysname $newname;
}
:set textfilename ($"newdate" . "-" . $"sysname" . ".rsc")
:set backupfilename ($"newdate" . "-" . $"sysname" . ".backup")
:execute [/export file=$"textfilename"]
:execute [/system backup save name=$"backupfilename"]
#Allow time for export to complete
:delay 2s
#email copies
:log info "Send e-mail for backup"
/tool e-mail send to=$"toemail" from=$"fromemail" server=[:resolve $emailserver] port=25 tls=yes user=$"fromemail" password=$"pass" subject="[Backup Configuration] $sysname $time" file=$"textfilename"
#Send as different subjects to force GMail to treat as new message thread.
:local time [/system clock get time]
/tool e-mail send to=$"toemail" from=$"fromemail" server=[:resolve $emailserver] port=25 tls=yes user=$"fromemail" password=$"pass" subject="[Backup Configuration] $sysname $time" file=$"backupfilename
#Allow time to send
:delay 10s
#delete copies
/file remove $textfilename
/file remove $backupfilename