Community discussions

 
User avatar
laxmimikrotik
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Tue Apr 25, 2017 1:44 pm

How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 12:36 pm

I have 10 mikrotik's and i want take the backup automatically into my gmail .

please suggest me the steps .
Thanks.
-------------------------------
Every problem Has Solution .
ip-noc Team.
MTCNA ,MTCRE,
 
Shadeofspirit
Member Candidate
Member Candidate
Posts: 204
Joined: Fri May 27, 2016 12:15 am
Location: Minsk
Contact:

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 12:45 pm

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
MTCNA, MTCWE
 
freemannnn
Long time Member
Long time Member
Posts: 669
Joined: Sun Oct 13, 2013 7:29 pm

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 12:46 pm

take a look at the link above. i am using this script.

https://www.mikrotik-routeros.com/2014/ ... ps-folder/
 
User avatar
laxmimikrotik
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Tue Apr 25, 2017 1:44 pm

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 12:54 pm

But you have lots of script in your provided link . Do i have to enter all the scripts in the mikrotik ??
Thanks.
-------------------------------
Every problem Has Solution .
ip-noc Team.
MTCNA ,MTCRE,
 
msatter
Forum Guru
Forum Guru
Posts: 1300
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 1:12 pm

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.
Two RB760iGS (hEX S) in series. One does PPPoE and both do IKEv2.
Running:
RouterOS 6.46Beta59 / Winbox 3.20 / MikroTik APP 1.3.7
Having an Android device, use https://github.com/M66B/NetGuard/releases (no root required)
 
User avatar
laxmimikrotik
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 58
Joined: Tue Apr 25, 2017 1:44 pm

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 1:55 pm

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 ??
Thanks.
-------------------------------
Every problem Has Solution .
ip-noc Team.
MTCNA ,MTCRE,
 
Shadeofspirit
Member Candidate
Member Candidate
Posts: 204
Joined: Fri May 27, 2016 12:15 am
Location: Minsk
Contact:

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 2:07 pm

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
MTCNA, MTCWE
 
msatter
Forum Guru
Forum Guru
Posts: 1300
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: How to take the Backup of my mikrotik automatically into my gmail on daily basis

Fri Jun 09, 2017 2:42 pm

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 ??
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:T ... 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
Two RB760iGS (hEX S) in series. One does PPPoE and both do IKEv2.
Running:
RouterOS 6.46Beta59 / Winbox 3.20 / MikroTik APP 1.3.7
Having an Android device, use https://github.com/M66B/NetGuard/releases (no root required)

Who is online

Users browsing this forum: No registered users and 108 guests