Community discussions

 
ceylan
just joined
Topic Author
Posts: 24
Joined: Sat Feb 10, 2018 3:03 pm
Location: CYPRUS
Contact:

Generate backup and send it by e-mail

Sat Mar 16, 2019 1:05 pm

I want to learn step by step smtp server configuration and than generate backup and send it by e-mail to my e-mail and i want that monthly automatically. i am trying this ex. " https://wiki.mikrotik.com/wiki/Manual:S ... _by_e-mail " . i have gmail address and you can see my Forwarding and POP/IMAP settings in gmail.
You do not have the required permissions to view the files attached to this post.
 
User avatar
k6ccc
Member
Member
Posts: 480
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)

Re: Generate backup and send it by e-mail

Mon Mar 18, 2019 6:38 am

I am doing exactly that. Here are the settings:
First setup your E-Mail server information. I am using a G-Mail account.
/tool e-mail
set address=smtp.gmail.com from="Router #2" password=Redacted port=587 \
    start-tls=yes user=address@gmail.com

Then the script that creates the files and sends them:
# Policies needed:  ftp, read, policy, sensitive, test
# Policies NOT needed:  password, reboot, write, sniff, romon
:log info "Starting daily backup";
/system backup save name=RB750-2_Daily
/system package print file RB750-2_Version.txt
:delay 00:00:01
/tool e-mail send file=RB750-2_Daily.backup to="jim@Redacted.com" body="Router #2 daily backup file attached." \
   subject="RB750r2-2  $[/system clock get date] at $[/system clock get time]  Backup"
/ export file RB750-2_Daily
:delay 00:00:10
/tool e-mail send file=RB750-2_Daily.rsc,RB750-2_Version.txt to="jim@Redacted.com" body="Router #2 daily script and version files attached." \
   subject="RB750r2-2  $[/system clock get date] at $[/system clock get time]  Script"
:log info "Daily backup script completed"

Then set a schedule. In my case, this router sends backups every day at 22:32:00:
/system scheduler
add interval=1d name="Daily backup" on-event="Daily Backup" policy=\
    ftp,read,write,policy,test,password,sniff,sensitive start-date=\
    jul/12/2016 start-time=22:32:00
RB750Gr3, RB750r2, CRS326-24G-2S (in SwitchOS), CSS326-24G-2S, CSS106-5G-1S, RB260GS
Not sure if I beat them in submission, or they beat me into submission


Jim
 
ceylan
just joined
Topic Author
Posts: 24
Joined: Sat Feb 10, 2018 3:03 pm
Location: CYPRUS
Contact:

Re: Generate backup and send it by e-mail

Fri Mar 29, 2019 11:41 am

YES thnks. i have one more question if you can halp :) when internet usage falls below 10 Mbit and if it exceeds 100 Mbit,can we send e-mail?

Who is online

Users browsing this forum: No registered users and 26 guests