fbpx

Can you make automatic backups in MikroTik and send them to FTP or TFTP?

Yes, it is possible to configure automatic backups on MikroTik devices and send them to an FTP or TFTP server. This is a best practice to ensure you have a backup of your device settings, which can be vital for quick recovery from hardware failures or misconfigurations. Here I detail how to do it:

Step 1: FTP or TFTP Server Configuration

Before you can send backup files, you need to have a functioning FTP or TFTP server that the MikroTik device can access. You must ensure that the server is properly configured to accept connections and store files.

Step 2: Create the Backup Script

In MikroTik RouterOS, you can create a script that generates the backup and sends it to the server. Here's a basic example of what this FTP script might look like:

/system backup save name=backup_auto
/tool fetch address=192.168.1.100 src-path=backup_auto.backup user=ftpuser password=ftppass mode=ftp dst-path=/mikrotik_backups/backup_auto.backup upload=yes

In this script:

  • First a backup file called backup_auto.backup.
  • Then use the command /tool fetch to send the file to the FTP server. Change 192.168.1.100 with the IP address of your FTP server, and set the user credentials (ftpuser y ftppass) and the destination route (/mikrotik_backups/) depending on your configuration.

For TFTP, the script would be similar, but you must change the mode a tftp and it may not be necessary to specify username and password, depending on the configuration of your TFTP server.

Step 3: Automate the Script

To have the backup done automatically, you can schedule the script to run at regular intervals using MikroTik's Scheduler.

/system scheduler
add name="Backup Diario" start-date=apr/01/2023 start-time=03:00:00 interval=1d on-event="/system script run backup_script"

This scheduler will execute the script called backup_script every day at 03:00 AM. Make sure the event name on-event matches the name you have given to your backup script.

Step 4: Verification and Security

  • Verifica that backups are being successfully created and uploaded to the server as scheduled.
  • Ensures your FTP or TFTP server, especially if it is accessible from the Internet. Use strong passwords and consider using private networks or VPNs for file transfers.

Setting up automatic backups to an FTP or TFTP server is an effective way to ensure that you maintain a secure copy of the configuration of your MikroTik devices, making it easier to manage your backups and recover your system.

There are no tags for this post.
Did this content help you?
Facebook
Twitter
LinkedIn
WhatsApp
Telegram

Other documents in this category

Leave your comment

Your email address will not be published. Required fields are marked with *

Tutorials available at MikroLABs

No Courses Found!

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011