Hallo,
i made this simple script in order to backup daily the router settings and usermanager database, using sd-card as buffer in order to reduce router nand's use.
It is especially useful when yuo plan to enlarge usermanager database until gigabyte size, making backup into router's nand not more possible.
I'll write also another script to "rebuild" database and logs every week, to reduce backup's size.
This script will erase always the same two files, in order to have always the last good version in ftp.
#automated System
:log info message=System_Export_started;
:local exportname ([/system identity get name].".rsc");
:local UMname ([/system identity get name].".umb");
export compact file=micro-sd/exportSy.rsc;
/tool user-manager database save name=micro-sd/backupUM.umb;
:log info message=System_Export_finished;
Upload the System Backup to External FTP;
/tool fetch address=192.168.1.1 port=21 src-path=micro-sd/exportSy.rsc upload=yes
user=FTPuser mode=ftp password="FTPpassword" dst-path=$exportname;
/tool fetch address=192.168.1.1 port=21 src-path=micro-sd/backupUM.umb upload=yes
user=FTPuser mode=ftp password="FTPpassword" dst-path=$UMname;
/file remove micro-sd/backupUM.umb;
/file remove micro-sd/exportSy.rsc;
:log info message=System_Export_uploaded;
where you have to put your ftp server address instead of "192.168.1.1" and your FTP user and password.
I take inspiration from this post: Backup to External FTP Useful script and I hope it will be useful for someone. ![]()
It works with RouterOS 6.2 .