Mikrotik - Automated configuration backup

This is just a short note, more information can be found directly at the MikroTik Wiki - Automated Backups.

First step

Define mail server:

/tool e-mail
set address=10.23.23.1 \
    from=email@address \
    user=email_user \
    password=email_password \
    port=25 \
    starttls=yes 

Second step

Create script to store and send configuration:

/system script add name="email-backup" source={
/export file=backup.rsc;
/tool e-mail send to="destination_email@address" \
      subject=([/system identity get name]." backup") \
      file=backup.rsc;
:log info "Backup email sent.";  }

Third step

Execute script every four weeks:

/system scheduler
add disabled=no interval=4w name=email-backup-schedule \
    on-event="/system script run email-backup" \
    start-date=jun/08/2012 start-time=9:50:00

To check current run count and next run date execute similar command:

[admin@mt] /system scheduler> print detail 
Flags: X - disabled 
 0   name="email-backup-schedule" 
     start-date=jun/08/2012 start-time=09:50:00 interval=4w
     on-event=/system script run email-backup owner="admin" 
     run-count=1 next-run=jul/06 09:50:00
Milosz Galazka's Picture

About Milosz Galazka

Milosz is a system administrator working for a successful Polish company and a long time supporter of Free Software Foundation and Debian operating system.

Gdansk, Poland https://sleeplessbeastie.eu