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 shedulerI have 10 mikrotik's and i want take the backup automatically into my gmail .
please suggest me the steps .
in "send email" - nothingi 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 ??
Updated the script due to strange characters in the copy-paste from the original site.i want to show u something but i cant add the attachments ..
Please explain me it step by step .....what should I enter in these above steps ??
#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